C programming examples with output
Palindrome Number
Program
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,d;
clrscr();
printf("Enter any number: ");
scanf("%d",&a);
b=a;
c=0;
while(n>0)
{
d=a%10;
c=(c*10)+d;
a=a/10;
}
if(b==c)
printf("%d is Palindrome Number",b);
else
printf("%d is not Palindrome Number",b);
getch();
}
Output
Enter any number:135
135 is not Palindrome Number
Enter any number:121
121 is Palindrome NUmber
Palindrome Number
Program
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,d;
clrscr();
printf("Enter any number: ");
scanf("%d",&a);
b=a;
c=0;
while(n>0)
{
d=a%10;
c=(c*10)+d;
a=a/10;
}
if(b==c)
printf("%d is Palindrome Number",b);
else
printf("%d is not Palindrome Number",b);
getch();
}
Output
Enter any number:135
135 is not Palindrome Number
Enter any number:121
121 is Palindrome NUmber