0
Can anyone check please?
3 Answers
+ 5
Use while condition and == operator for comparison.
//palindrome or not checking
#include <stdio.h>
int main() {
int n, rev=0, rem, temp;
scanf("%d", &n);
temp= n;
while(n!=0){
rem= n%10;
rev= rev*10+rem;
n= n/10;
}
if(temp== rev){
printf ("num is palindromic");
}
else printf ("not a palindrome number");
return 0;
}
+ 4
Very wlcm
+ 2
Thank you Aditya