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 / prashant gupta

//in C Language

#include <stdio.h>
#include <conio.h>

int main()

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

while(number>0)
{
remainder=number%10; //Gets Last Digit
number/=10; //Truncates Last Digit
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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is different in C++, compare with unix?

1030


What is expression parser in c++

2445


What do you mean by enumerated data type?

1012


What is the purpose of ios::basefield in the following statement?

1211


Is overriding possible in c++?

965


What do you mean by translation unit in c++?

1306


What is the advantage of c++ over c?

981


What is the benefit of c++?

1074


Which operator cannot overload?

1000


To which numbering system can the binary number 1101100100111100 be easily converted to?

1014


What is cin clear () in c++?

1149


How can you say that a template is better than a base class?

1039


What are pointer-to-members in C++? Give their syntax.

1102


How many different levels of pointers are there?

1176


Is c++ faster than c?

987