/* 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:-
#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();
}
****************************************************
*******************************************************************************
ਧੰਨਵਾਦ
(ਰ. ਸਿੰਘ )
PSEBNOTES.BLOGSPOT.COM
Attttt
ReplyDeletehttps://www.computersciencepseb.blogspot.com
ReplyDeletehttp://computersciencepseb.blogspot.com/
ReplyDelete