Make a new start with a new Thought!

NOTE :                // indicates comments.This wont get printed in the output.This is used for for documentation purpose. PROGRAM: #incl...

PALINDROME NUMBER

NOTE :
              
// indicates comments.This wont get printed in the output.This is used for for documentation purpose.

PROGRAM:

#include<stdio.h>
#include<conio.h>
void main()
{
  int rem,rev=0,num,n,temp;
  clrscr();
  printf("Enter any number\t:\t");
  scanf("%d",&num);
  n=num;
  while(n!=0)
  {
    rem=n%10;
    rev=rev*10 + rem;
    n=n/10 ;
  }
  if(num==rev)
  {
    printf("%d is palindrome",num);
  }
  else
  {
    printf("%d is not palindrome",num);
  }
 getch();
}


OUTPUT :



0 comments: