23rd May 2021, 5:11 PM
Ira Sarkar
Ira Sarkar - avatar
3 Réponses
+ 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; }
23rd May 2021, 5:24 PM
Aditya
Aditya - avatar
+ 4
Very wlcm
23rd May 2021, 5:30 PM
Aditya
Aditya - avatar
+ 2
Thank you Aditya
23rd May 2021, 5:30 PM
Ira Sarkar
Ira Sarkar - avatar