code to reverse a 4=digit number+finding if 4 digit number is a palindrome
Hi everyone,
Just started learning C.I worked on the first part and wrote a code that finds the reverse of the 4 digit number.But i am unsure as to what to do about the palindrome thing.I have to use only if-else statements.Please help me out with this one.Thanks!!
Code:
# include<stdio.h>
int main()
{
int n;
printf("Enter a four-digit number:");
scanf("%d",&n);
printf("The reversed four digit number is %d,%d,%d,%d \n",(n%10),(n/10)%10,(n/100)%10,n/1000);
return (0);
}