BLOG TO HELP STUDENTS TO MAINTAIN THEIR NOTES

Wednesday 6 February 2019

C Program to Check Whether a Number is Palindrome or Not


/* program to check whether the number is palindrome no or not */

#include<stdio.h>
#include<conio.h>
void main()
{
   int n,no=0;
   int t, s;

   printf("enter any number  ");
   scanf("%d",&n);
   s=n;
   
while(n>0)
   {
     t= n%10;
     no=no*10+t;
     n=n/10;
   }

    if(no==s)
    {
      printf("palindrome number");
    }
    else
    {
      printf("not a palindrome number");
    }

   getch();

   }
****************************************************

Explanation:-
*******************************************************************************
ਧੰਨਵਾਦ 
(ਰ. ਸਿੰਘ )

PSEBNOTES.BLOGSPOT.COM

3 comments: