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
In what scenario does the Logical file and Physical file being used?
What are the components of stl?
Is string part of stl?
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.
What is a standard template library (stl)? What are the various types of stl containers?
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
How do I convert a stl file?
Is stl part of c++ standard?
What is the stl, standard template library?
What are stl algorithms?
what is template and type convertion
What is a stl vector?
What is a standard template library (stl)?
write a program to convert a decimal number in to its equivalent binary number?
What is a list in c++ stl?