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 a program that input four digit no and finds it is
palindrome or not

Answer Posted / karthik p b

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

void main()
{
int n,rev=0,rem, temp,i;

printf(" Enter the 4 digit number :\n");
scanf("%d", &n);

temp = n;
for(i=1;i<=4;i++)
{
rem = n % 10;
n = n/10;
rev = rev * 10 + rem;
}

if(temp == rev)
printf(" Its a palindrome:\n");
else
printf(" Not a palindrome:\n");
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In what scenario does the Logical file and Physical file being used?

2834


What are the components of stl?

1084


Is string part of stl?

1186


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2431


What is a standard template library (stl)? What are the various types of stl containers?

1143


help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase

2357


How do I convert a stl file?

1084


Is stl part of c++ standard?

1080


What is the stl, standard template library?

1077


What are stl algorithms?

1150


what is template and type convertion

2446


What is a stl vector?

1229


What is a standard template library (stl)?

1104


write a program to convert a decimal number in to its equivalent binary number?

2648


What is a list in c++ stl?

1152