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 are the implicit member functions of class?

1049


What programming language should I learn first?

1054


Give an example of run-time polymorphism/virtual functions.

973


Can a class be static in c++?

1059


What is a terminating character in c++?

1339


How can you quickly find the number of elements stored in a static array?

1064


Can turbo c++ run c program?

1053


What do nonglobal variables default to a) auto b) register c) static

1118


What you know about structures in C++?

1027


Out of fgets() and gets() which function is safe to use?

1089


What is encapsulation in C++? Give an example.

1047


explain the reference variable in c++?

1029


What are the advantages of using pointers in a program?

1114


What is the difference between map and hashmap in c++?

1059


Explain one method to process an entire string as one unit?

1545