I have written a code to find reverse of a number and print if if the original and reversed numbers are equal or not .the problem is in the if condition where the first printf is not working at all.
the code is
#include <stdio.h>
#include <conio.h>
int main (void)
{
int num1;
int numr=0;
printf("Enter the three digit number : ");
scanf("%d", &num1);
while(num1!=0)
{
numr=numr*10;
numr=numr + num1%10;
num1=num1/10;
}
printf("The reverse of entered number is= %d\n",numr);
if(num1==numr)
printf("original and reversed numbers are equal\n",num1);
else
printf("original and reversed numbers are not equal\n",num1);
getch ();
return 0;
}
as if i enter 121 it still shows the 2nd printf instead of 1st one.please sort out the bug;;!