-
what is wrong here?
*hits her head against the monitor* I just can't see why I'm getting the result I'm getting....
#include <stdio.h>
int main()
{
int x,y;
long int result;
x= 1000;
y= 7000;
result= x*y;
printf("The results of 1000 multiplied by 7000 is %lu.\n", result);
return 0;
}
And it's coming out to be...53184? Eh?
-
I compiled your code and I get 7000000. Change x and y into long int.
-
on my compiler (bloodshed dev c++ 4) and computer (athlon 1ghz) i'm getting 7000000
maybe on your computer and compiler ints are plus/minus ~37000.
in either case, try making x and y long ints, then recompile and tell us your results.
-
yay! it works now!
it works now. Making x and y long got it to work. Thanks you two