Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is array of pointers to string?

1019


C program to find all possible outcomes of a dice?

2309


Difference between exit() and _exit() function?

1094


What is variable initialization and why is it important?

1188


Can a void pointer point to a function?

984


How can you pass an array to a function by value?

1078


How can I determine whether a machines byte order is big-endian or little-endian?

1025


What does the file stdio.h contain?

1021


What are examples of structures?

1052


What are pragmas and what are they good for?

952


What does. int *x[](); means ?

1027


What is pivot in c?

994


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2709


What is the value of uninitialized variable in c?

997


What is the purpose of the statement: strcat (S2, S1)?

1127