The main output of the following program is:
The main source code of the program is:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int n,rev=0,num,r,x; | |
int palindrome(int n); | |
int main() | |
{ | |
printf("enter the number to check whether it is palindrome or not\n"); | |
scanf("%d",&n); | |
palindrome(n); | |
if(x==0) | |
{ | |
printf("the num is palindrome"); | |
} | |
else | |
{ | |
printf("the no is not palindrome"); | |
} | |
getch(); | |
} | |
int palindrome(int n) | |
{ | |
num=n; | |
while(n!=0) | |
{ | |
r=n%10; | |
rev=rev*10+r; | |
n=n/10; | |
} | |
if(rev==num) | |
{ | |
return 0; | |
} | |
else | |
{ | |
return 1; | |
} | |
} |
0 comments :
Post a Comment