Active Members
TodayLast 7 Daysmore...


Resources » Articles/Knowledge Sharing » Computer & Technology

C program to check the given number is palindrome or not


Posted Date:     Category: Computer & Technology    
Author: Member Level: Gold    Points: 3



 

#include< stdio.h >
#include< conio.h >

main()
{
long int num,rev,temp,rem;

clrscr();
printf("Enter a number ");
scanf("%ld",&num);

temp = num;
rev = 0
while (num != 0)
{
rem = num % 10;
rev = rev * 10 + rem;
num = num / 10;
}
if ( temp == rev)
printf("%ld is a palindrome number ", temp);
else
printf("%ld is not a palindrome number ", temp);
}


K. Srinivasa Rao
Community Owner - C Language Learners

Reference http://www.indiastudychannel.com/sites/148114/-C-Language-Learners.aspx





Did you like this resource? Share it with your friends and show your love!





Responses to "C program to check the given number is palindrome or not"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Basic about CDONTS
    Previous Resource: core java
    Return to Resources
    Post New Resource
    Category: Computer & Technology


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    C Program  .  Using while loop  .  Palindrome  .  
    Awards & Gifts
    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.