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

What is the difference between functions getch() and getche()?

609


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1479


What is 2 d array in c?

544


Which is best book for data structures in c?

588


Explain about block scope in c?

651






printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

624


Write a program to print fibonacci series without using recursion?

594


a value that does not change during program execution a) variabe b) argument c) parameter d) none

682


What is #include stdlib h?

604


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2972


What functions are in conio h?

643


What are global variables and explain how do you declare them?

561


Why c is called a middle level language?

626


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

590


what is ur strangth & weekness

1804