Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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


Please Help Members By Posting Answers For Below Questions

Is the exit() function same as the return statement? Explain.

261


Why use int main instead of void main?

195


How are pointers declared in c?

211


Can a file other than a .h file be included with #include?

241


Differentiate between declaring a variable and defining a variable?

232






Are the variables argc and argv are always local to main?

226


What does typeof return in c?

176


Is there any demerits of using pointer?

231


What is the difference between struct and typedef struct in c?

208


What are the advantages of using macro in c language?

201


What is the data segment that is followed by c?

231


How can I make it pause before closing the program output window?

219


Explain what is meant by high-order and low-order bytes?

228


What standard functions are available to manipulate strings?

223


Who developed c language and when?

213