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

How do I use arrays in c++?

1014


What is stack unwinding?

1154


What is this weird colon-member (" : ") syntax in the constructor?

1032


What is the use of c++ programming language in real life?

1053


What kind of problems can be solved by a namespace?

1102


How do you compile the source code with your compiler?

1069


How does list r; differs from list r();?

1168


Differentiate between an inspector and a mutator ?

1235


How do you add an element to a set in c++?

1001


Is map sorted c++?

1015


What is extern c++?

1013


What is setf in c++?

1098


When can I use a forward declaration?

1110


What is binary object model?

1038


Which ide is best for c++?

1053