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 / kifle tadesse mit
1# include<stdio.h>
2 int main()
3 {
4 int n,n1,rem,rev=0;
5 printf("enter the number u want to reverse\n");
6 scanf("%d",&n);
7n1=n;
8 while(n>0)
9{
10 rem=n%10;
11 rev=rev*10+rem;
12 n=n/10;
13 }
14 if(n1==rev)
15 printf("the given no is palindrome");
16 else
17 {
18 printf("no is not palindrome\n");
19 printf(" its palindrome by attaching it's reverse is
%d%d\n",n1,rev);
20 }return 0;
21 }
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Do you know the difference between malloc() and calloc() function?
What Is The Difference Between Null And Void Pointer?
Is exit(status) truly equivalent to returning the same status from main?
Write a program to print factorial of given number without using recursion?
how we can make 3d venturing graphics on outer interface
how to find anagram without using string functions using only loops in c programming
What is the right type to use for boolean values in c? Is there a standard type?
Explain which function in c can be used to append a string to another string?
What is variable and explain rules to declare variable in c?
what are bit fields in c?
What is I ++ in c programming?
Is struct oop?
How can I avoid the abort, retry, fail messages?
Why enum is used in c?
Why is c called c?