help with this code

guys do u know whats wrong with this code? the final answer is incorrect.
#include<stdio.h>
int main()
{
int a,b,c,d,e;

printf("Enter a number: ");
scanf("%d", &a);
if (a < 10 || a>100)
{
printf("error");
return 0;
}
b = a / 10;
c = a % 10;
d = c * 10 + b;
printf("%d\n",d);
e = a-d;
printf("the result is %d",&e );
return 0;
}
In C++, an int divided by an int gives an int.

Here are some examples.

5/10 = 0
9/10 = 0
99/10 = 9
try using a double...

double a,b,c,d,e;
Topic archived. No new replies allowed.