Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write program for palindrome

Answer Posted / gaurav joshi

#include <stdio.h>
int main()

{
int number,temp,remainder,sum=0;
printf("nnEnter no: ");
scanf("%d",&number);
temp = number; //Value of temp stores unmodified n value

while(number>0)
{
remainder=number%10;
number/=10;
sum=sum*10 + remainder; //Builds value of reversed number
}

if (sum==temp)
printf ("nThe Number Is A Palindrome ");
else
printf ("nThe Number Is Not A Palindrome ");

getch ();
return 0;

}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if a pointer is deleted twice?

1225


What can I use instead of namespace std?

1076


What is the use of endl in c++?

978


Are there any special rules about inlining?

1027


What is data hiding c++?

1000


What is c++ used for in games?

1102


Explain what are single and multiple inheritances in c++?

977


What is an arraylist c++?

1160


Comment on c++ standard exceptions?

1045


When are exception objects created?

1021


How the keyword struct is different from the keyword class in c++?

990


What is array in c++ pdf?

1093


What is pointer in c++ with example?

1014


What is difference between array and vector in c++?

978


How is computer programming useful in real life?

1004