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

Why cstdlib is used in c++?

1045


Differences between private, protected and public and give examples.

1070


Which function should be used to free the memory allocated by calloc()?

1025


If there are two catch statements, one for base and one for derived, which should come first?

1031


In c++, what is the difference between method overloading and method overriding?

1147


What can c++ be used for?

1101


What is scope in c++ with example?

1113


What is iterator c++?

992


What does obj stand for?

1170


What is the hardest coding language to learn?

1042


How a new operator differs from the operator new?

1124


What is the type of 'this' pointer? When does it get created?

953


Can a function take variable length arguments, if yes, how?

1016


Which operator cannot be overloaded c++?

1016


What are the comments in c++?

989