C Program to Check Whether a Number is Palindrome or Not

Palindrome Number or not in C Language

C Program to Check Whether a Number is Palindrome or Not:

This program reverses an integer (entered by the user) using while loop. Then, if statement is used to check whether the reversed number is equal to the original number or not.
#include <stdio.h>
int main()
{
int n, reversedInteger = 0, remainder, originalInteger;

printf("Enter an integer: ");
scanf("%d", &n);

originalInteger = n;

// reversed integer is stored in variable
while( n!=0 )
{
remainder = n%10;
reversedInteger = reversedInteger*10 + remainder;
n /= 10;
}

// palindrome if orignalInteger and reversedInteger are equal
if (originalInteger == reversedInteger)
printf("%d is a palindrome.", originalInteger);
else
printf("%d is not a palindrome.", originalInteger);

return 0;
}
Output

Enter an integer: 1001
1001 is a palindrome.

71 thoughts on “C Program to Check Whether a Number is Palindrome or Not”

  1. I just want to tell you that I’m beginner to weblog and truly loved this web site. Likely I’m likely to bookmark your blog . You surely have good well written articles. Thanks for revealing your web-site.

  2. I simply want to tell you that I am just newbie to blogging and site-building and actually liked you’re blog. Almost certainly I’m likely to bookmark your website . You surely have fantastic articles and reviews. With thanks for sharing with us your blog.

  3. Thanks for the sensible critique. Me and my neighbor were just preparing to do some research about this. We got a grab a book from our local library but I think I learned more from this post. I am very glad to see such wonderful information being shared freely out there.

  4. Hey there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Internet explorer. I’m not sure if this is a formatting issue or something to do with browser compatibility but I figured I’d post to let you know. The style and design look great though! Hope you get the problem resolved soon. Thanks

  5. I am glad for commenting to let you be aware of of the remarkable experience my friend’s girl gained studying the blog. She discovered some issues, including what it’s like to possess an incredible coaching style to have other individuals clearly thoroughly grasp a variety of tricky subject matter. You actually exceeded readers’ expectations. Thank you for presenting these valuable, dependable, educational as well as unique guidance on your topic to Evelyn.

  6. Good – I should definitely pronounce, impressed with your site. I had no trouble navigating through all tabs and related information ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or anything, website theme . a tones way for your client to communicate. Nice task.

  7. Excellent read, I just passed this onto a colleague who was doing a little research on that. And he just bought me lunch as I found it for him smile Therefore let me rephrase that: Thanks for lunch!

  8. I truly appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You’ve made my day! Thank you again!

  9. After study just a few of the blog posts in your website now, and I truly like your way of blogging. I bookmarked it to my bookmark web site listing and can be checking back soon. Pls check out my website online as nicely and let me know what you think.

  10. I just want to mention I am just very new to weblog and certainly savored your blog site. More than likely I’m want to bookmark your blog . You definitely come with excellent articles. Thank you for sharing with us your website page.

  11. Yet another thing to mention is that an online business administration course is designed for scholars to be able to smoothly proceed to bachelor’s degree education. The 90 credit diploma meets the other bachelor diploma requirements when you earn your associate of arts in BA online, you will possess access to the newest technologies with this field. Several reasons why students want to get their associate degree in business is because they may be interested in this area and want to obtain the general education and learning necessary in advance of jumping right bachelor diploma program. Many thanks for the tips you actually provide in your blog.

  12. Greetings! I know this is kinda off topic however , I’d figured I’d ask. Would you be interested in trading links or maybe guest authoring a blog post or vice-versa? My site discusses a lot of the same topics as yours and I feel we could greatly benefit from each other. If you happen to be interested feel free to shoot me an e-mail. I look forward to hearing from you! Fantastic blog by the way!

  13. The subsequent time I read a blog, I hope that it doesnt disappoint me as much as this one. I imply, I do know it was my choice to read, however I really thought youd have one thing attention-grabbing to say. All I hear is a bunch of whining about something that you could possibly repair when you werent too busy looking for attention.

  14. hello there and thanks in your info – I have definitely picked up anything new from proper here. I did alternatively expertise some technical points the use of this site, as I experienced to reload the website lots of occasions previous to I may just get it to load properly. I were thinking about in case your web host is OK? No longer that I am complaining, however slow loading circumstances times will often have an effect on your placement in google and could damage your high-quality ranking if advertising and ***********|advertising|advertising|advertising and *********** with Adwords. Anyway I am including this RSS to my e-mail and can look out for a lot extra of your respective intriguing content. Ensure that you update this again very soon..

  15. Thanks for the guidelines shared in your blog. Yet another thing I would like to state is that weight loss is not all about going on a celebrity diet and trying to get rid of as much weight as you’re able in a few months. The most effective way in losing weight is by acquiring it little by little and using some basic guidelines which can allow you to make the most out of your attempt to lose weight. You may know and already be following a few of these tips, nevertheless reinforcing knowledge never hurts.

  16. Having read this I thought it was very informative. I appreciate you spending some time and energy to put this short article together. I once again find myself spending a significant amount of time both reading and leaving comments. But so what, it was still worth it!

  17. Howdy, I think your website could possibly be having web browser compatibility problems. Whenever I look at your web site in Safari, it looks fine however when opening in IE, it has some overlapping issues. I just wanted to give you a quick heads up! Other than that, great website!

  18. Aw, this has been an extremely nice post. In thought I must place in writing similar to this moreover – taking time and actual effort to create a great article… but what / things I say… I procrastinate alot and also by no indicates appear to get something accomplished.

  19. Hello! I could have sworn I’ve been to this site before but after looking at a few of the posts I realized it’s new to me. Nonetheless, I’m certainly happy I stumbled upon it and I’ll be bookmarking it and checking back regularly!

  20. After I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I recieve four emails with the exact same comment. There has to be a means you can remove me from that service? Many thanks.

  21. After I originally left a comment I appear to have clicked the -Notify me when new comments are added- checkbox and now whenever a comment is added I get 4 emails with the exact same comment. Perhaps there is an easy method you can remove me from that service? Thanks.

  22. Thank you a lot for giving everyone an extremely brilliant opportunity to discover important secrets from here. It is always very terrific and stuffed with fun for me personally and my office friends to search your site at the very least thrice per week to learn the newest items you have got. Of course, we are at all times contented with all the splendid thoughts you serve. Some 2 ideas on this page are unquestionably the most suitable I have had.

  23. Hi, I do believe this is an excellent website. I stumbledupon it 😉 I may come back yet again since I saved as a favorite it. Money and freedom is the greatest way to change, may you be rich and continue to help others.

  24. I am so happy to read this. This is the kind of manual that needs to be given and not the accidental misinformation that’s at the other blogs. Appreciate your sharing this greatest doc.

  25. What’s Taking place i am new to this, I stumbled upon this I have found It absolutely useful and it has helped me out loads. I am hoping to give a contribution & help other users like its helped me. Good job.

  26. Hello there, There’s no doubt that your website could be having web browser compatibility problems. When I take a look at your web site in Safari, it looks fine however, if opening in IE, it has some overlapping issues. I simply wanted to provide you with a quick heads up! Besides that, excellent blog.

  27. Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! However, how could we communicate?

  28. The when I just read a blog, I’m hoping that this doesnt disappoint me approximately this one. Get real, Yes, it was my method to read, but When i thought youd have something interesting to state. All I hear is a number of whining about something that you could fix should you werent too busy trying to find attention.press release

  29. An intriguing discussion is definitely worth comment. I think that you need to publish more about this topic, it might not be a taboo matter but typically people do not talk about such topics. To the next! Cheers.

  30. I’d ought to seek advice from you here. Which isn’t some thing Which i do! I enjoy reading an article which will make people believe. Also, thanks for allowing me to comment!

  31. Your style is very unique compared to other people I’ve read stuff from. Many thanks for posting when you’ve got the opportunity, Guess I’ll just book mark this site.

  32. You made some respectable factors there. I regarded on the internet for the problem and located most individuals will go along with with your website.

Leave a Reply

Your email address will not be published.