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 (mekelle institu
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);
7.n1=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 ? | 2 Yes | 0 No |
Post New Answer View All Answers
Write a program to check whether a number is prime or not using c?
Why is event driven programming or procedural programming, better within specific scenario?
What is .obj file in c?
what is a function method?give example?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
Differentiate Source Codes from Object Codes
What is difference between constant pointer and constant variable?
What is queue in c?
Can you tell me how to check whether a linked list is circular?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
Explain what are run-time errors?
What is a example of a variable?
Explain the properties of union. What is the size of a union variable
What is the function of this pointer?