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
How stl is different from the c++ standard library?
What is a standard template library (stl)?
Is there any error below, its a code to delete all entires from a map #include
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
What two types of containers does the stl provide?
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999
When did c++ add stl?
What are the various types of stl containers?
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
How do you convert stl to steps?
Define stl.
Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister
how to making game in c++ ?
Name the different types of stl containers.
Explain stl.