Nokia 603 Symbian |
Information about resetting and configuring Mobile phones (Java, Android, Symbian etc), educational articles especially for programming in C, C++ and Java and more about Computers and operating systems
How to Hard Reset Nokia 603 Symbian Belle Full Touch Smartphone
Labels:
buttons
,
complete reset
,
full reset
,
full touch
,
Hard reset
,
key combination
,
mobile
,
Nokia
,
Nokia 603
,
phone
,
reset
,
s60
,
smartphone
,
software
,
Symbian Belle
,
total reset
C and C++ Programs for String Sorting
Here i am writing programs in c and c++ languages to sort a given number of strings. Sorting is carried out based on the ASCII values of the letters in the strings. The string comparing function strcmp() is used in the program. These programs sort a given set of strings in ascending order.To change it into descending order just replace > with < in comparison line. The comparison line in the code is marked by comment.
C Program:
C Program:
#include<stdio.h> #include<string.h> #include<conio.h> void main() {
Labels:
$ccpp
,
c language
,
c plus plus
,
C programming
,
C++
,
code
,
compiled code
,
compiled program
,
cpp
,
program
,
sorting
,
source code
,
string
,
string sorting
C Program for Subtraction Without Using Minus Sign
The following is a program to subtract a number from another without using minus symbol. Instead of doing a normal subtract operation, the two's complement of the subtrahend is added to the minuend. (In 3-4, 3 is minuend and 4 is subtrahend.) In other words, the 1's complement and 1 is added to minuend.
#include<stdio.h> void main() { int a,b,sum; printf("Enter any two integers: ");
scanf("%d%d",&a,&b); sum = a + ~b + 1; printf("Difference of two integers: %d",sum); }
Labels:
$ccpp
,
1's
,
2's
,
c
,
complement
,
language
,
one's
,
program
,
programming
,
source code
,
subtraction
,
two's
C and C++ Programs to Find Sum of Digits of a Given Number
The following are C and C++ programs to find sum of digits of any given integer.
C Program
C Program
#include<stdio.h> #include<conio.h> void main() {
C and C++ Program for Swapping Two Numbers Without Third Variable
This post contains C and C ++ programs for swapping two given numbers without using any temporary variable. Only the two variables are required, not a third.
C Program
C Program
#include<stdio.h> void main() {
Labels:
$ccpp
,
c
,
C++
,
interchange
,
number swap
,
numbers
,
program
,
source code
,
swap
,
swapping
,
temporary
,
third
,
variable
,
without
C and C++ swapping numbers
The following are C and C++ programs to swap the values of two variables using a third variable.
C Program:
C Program:
#include<stdio.h> void main() { int x,y,temp; printf("Enter the value of xand y\n"); scanf("%d%d", &x, &y); printf("Before Swapping\n x= %d\n y = %d\n",x,y); temp = x; x= y; y = temp; printf("After Swapping\n x= %d\ny= %d\n",x,y); }
2 Different C and C++ Programs to Check Whether a Given String is Palindrome or Not
Here i am writing two different programs to check whether a given string (text) us palindrome or not. There are C and C++ programs for this.
C Programs:
(i) Using string functions:
(ii) Comparing Character by Character
C++ Programs:
(i) Using String functions:
C Programs:
(i) Using string functions:
#include<stdio.h> #include<string.h> #include<conio.h> void main() { char a[100],b[100]; printf("Enter the string to check if palindrome or not\n"); gets(a); strcpy(b,a); strrev(b); if(strcmp(a,b)==0) printf("\nEntered string is palindrome"); else printf("\nEntered string is not palindrome"); getch(); }
(ii) Comparing Character by Character
#include<string.h> #include<stdio.h> #include<conio.h> void main() { int len,i; char a[100]; printf("Enter the string to check whether it is palindrome or not\n"); gets(a); len=strlen(a); for(i=0;i<len/2;i++) { if(a[i]!=a[len-i-1]) break; } if(i==len/2) printf("\nEntered string is palindrome"); else printf("\nEntered string is not palindrome"); getch(); }
C++ Programs:
(i) Using String functions:
Labels:
$ccpp
,
c language
,
c plus plus
,
C programming
,
C++
,
code
,
coding
,
cpp
,
programming
,
programming language
,
programs
,
project
,
source code
C and C++ Program to Check Whether a Given Number is Even or Odd
C and C++ programs to check whether a given number is Odd or even
C Program
C++ Program
C Program
#include<stdio.h> void main() { int n; printf("Enter an integer\n"); scanf("%d",&n); if ( n%2 == 0 ) printf("Even"); else printf("Odd"); }
C++ Program
#include<iostream.h> void main() { int n; cout<<"Enter an integer\n"; cin>>n; if ( n%2 == 0 ) cout<<"\nEven"; else cout <<"\nOdd"; }
Labels:
$ccpp
,
c language
,
C++
,
check
,
checking
,
compiled program
,
even
,
given number
,
integer
,
odd
,
or
,
or not
,
program
,
source code
,
to
,
whether
C and C++ Program to Check Whether a Given Year is Leap Year or Not
This is post contains a C program and a C++ program to check whether an input year is leap year or not. A year is a leap year if:
C program
C++ program
- The year is divisible by 400
- The year is divisible by 4 but not divisible by 100.
C program
#include <stdio.h> void main() { int year; printf("Enter a year to check if it is a leap year\n"); scanf("%d", &year); if(year%400==0 || ((year%4=0) && (year%100!=0))) printf("%d is a leap year.\n", year); else printf("%d is not a leap year.\n", year); }
C++ program
#include <iostream.h> void main() { int year; cout<<"Enter a year to check if it is a leap year or not"; cin>>year; if(year%400==0 || ((year%4=0) && (year%100!=0))) cout<<"\n"<<year<<"is a leap year."; else cout<<"\n"<<year<<"is NOT a leap year."; }
Subscribe to:
Posts
(
Atom
)