I was born in the modern world, so I often have to deal with similar things, but someone can explain how to get the correct number in the following code. Here is one attempt by many:
#define X 2527 #define Y 2463 #define Z 3072 main() { long int c = X*Y*Z; printf("%ld",c); }
I'm just trying to print a long integer, but it always prints the wrong result. I get whole overflows - if so, how can I prevent them? Or is it my choice of printf format?
source share