Palindrome number | C language

About Palindrome:


Write a C-Program to check weather the number is palindrome or not:

Code:

#include<stdio.h>

#include<conio.h>

void main()

{

    int n,m,a,b=0;

    printf("Enter a number:\n");

    scanf("%d",&m);

    n=m;

    while(n!=0)

    {

        a=n%10;

        n=n/10;

        b=b*10+a;

    }

    printf("%d\n",b);

    if(b==m)

        printf("The number is palindrome");

    else

        printf("Not a palindrome");

    getch();

}

Output:

 

-------------------
C Program : String Palindrome

Comments

Popular posts from this blog

TOP 10 PROGRAMMING LANGAUAGES COMMING 2021 | ARTICLE

Write a C-program to swap two number:

Print Fibonacci Series using Recursion | C program :