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


Please Help Members By Posting Answers For Below Questions

Write a program to check whether a number is prime or not using c?

565


Why is event driven programming or procedural programming, better within specific scenario?

1939


What is .obj file in c?

637


what is a function method?give example?

1905


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.

2206






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

634


Differentiate Source Codes from Object Codes

807


What is difference between constant pointer and constant variable?

614


What is queue in c?

563


Can you tell me how to check whether a linked list is circular?

752


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

1577


Explain what are run-time errors?

597


What is a example of a variable?

537


Explain the properties of union. What is the size of a union variable

707


What is the function of this pointer?

655