C Program to find a number is palindrome or not - c programs
//C Program to find a number is palindrome or not
#include <stdio.h>
#include <conio.h>
main()
{
int n,t,s,r;
clrscr();
printf("enter any number");
scanf(%d",&n);
t=n;
s=0
while(n>0)
{
r=n%10;
s=(s*10)+r;
n=n/10;
}
if(t==s)
printf("%d is a palindrome number",t);
else
printf("%d is not a palindrome number",t);
gertch();
}
#include <conio.h>
main()
{
int n,t,s,r;
clrscr();
printf("enter any number");
scanf(%d",&n);
t=n;
s=0
while(n>0)
{
r=n%10;
s=(s*10)+r;
n=n/10;
}
if(t==s)
printf("%d is a palindrome number",t);
else
printf("%d is not a palindrome number",t);
gertch();
}
No comments:
Post a Comment