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
Explain the binary height balanced tree?
Is fortran faster than c?
How variables are declared in c?
Why is structure padding done in c?
What are the advantages of using new operator as compared to the function malloc ()?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
What is return in c programming?
how to create duplicate link list using C???
What is difference between class and structure?
What is time null in c?
largest Of three Number using without if condition?
What is dynamic dispatch in c++?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
How macro execution is faster than function ?
What are structural members?