adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

program in c to check a number is palindrome or not using function

Program in C to check a number is Palindrome or not using Function 


#include<stdio.h>
#include<conio.h>
 int CheckPalin(int n)
  {
      int rev=0;
      while(n!=0)
      {
          rev=n%10+10*rev;
          n=n/10;
      }
      return (rev);
  }
  int main()
  {
      int n1,r;
      printf("Enter a number:-");
      scanf("%d",&n1);
      r=CheckPalin(n1);
      if(n1==r)
        printf("%d is Palindrome No.",n1);
      else
        printf("%d is not Palindrome No.",n1);
      //getch();
      return 0;

  }
Output:-




Post a Comment

0 Comments