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

Difference between pointer to constant and constant pointer to a constant. Give example.

1132


Explain the benefits of proper inheritance.

1155


Do class declarations end with a semicolon? Do class method definitions?

1156


Mention the storage classes in c++.

1088


What are references in c++? What is a local reference?

1056


What do you mean by function overriding & function overloading in c++?

1199


What is called array?

1102


What is &x in c++?

1007


Do you know what are pure virtual functions?

1154


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

1012


What is the use of 'using' declaration in c++?

1143


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3933


Write a code/algo to find the frequency of each element in an array?

1126


Explain the difference between realloc() and free() in c++?

1026


What do manipulators do?

1023