Print all the palindrome numbers.If a number is not
palindrome make it one by attaching the reverse to it.
eg:123
output:123321 (or) 12321
Answer Posted / vikas shukla
# include<stdio.h>
int main()
{
int n,n1,rem,rev=0;
printf("enter the number\n");
scanf("%d",&n);
n1=n;
while(n>0)
{
rem=n%10;
rev=rev*10+rem;
n=n/10;
}
if(n1==rev)
{
prinntf("the given no is palindrome");
}
else
{
printf("no is not palindrome");
}return 0;
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the code for 3 questions and answer check in VisualBasic.Net?
What is adt in c programming?
How can I get the current date or time of day in a c program?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
what are the advantages of a macro over a function?
What is union and structure?
Why do we use static in c?
What is wrong with this statement? Myname = 'robin';
What is static volatile in c?
What is the basic structure of c?
Write a program to print factorial of given number using recursion?
What is nested structure with example?
What is an operator?
What are the applications of c language?
What is the c value paradox and how is it explained?