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 union in c?
What is data structure in c language?
What is the use of typedef in c?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Explain how do you determine whether to use a stream function or a low-level function?
How can I manipulate strings of multibyte characters?
How can you allocate arrays or structures bigger than 64K?
Under what circumstances does a name clash occur?
define string ?
What does the error message "DGROUP exceeds 64K" mean?
I came across some code that puts a (void) cast before each call to printf. Why?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What are qualifiers in c?
what is a constant pointer in C
What is difference between main and void main?