i need to write a function that inputs a number and tells if its palindrom or not
i wrote a code which calculates the length of the number and gets each cycle the digit
how to continue
?
Code:#include <stdio.h> int palindrom(int num); int main() { int t; t=palindrom(541); return 0; } int palindrom(int num) { int digit; int ans=0; int cnum,len=0;//length of the number //calculating the length of the array cnum=num; while (cnum/10) { digit=cnum%10; len++; cnum=cnum/10; } len++; return ans; }