this C code
unsigned long int a, b, x; float c, d, y; a = 6; b = 2; x = a/b; c = 6.0; d = 2.0; y = c/d; printf("\nx: %d \ny: %f \n",x,y);
works correctly and prints
x: 3 y: 3.000000
however, when I change the first line to this
unsigned long long int a, b, x;
I get this output:
x: 3 y: 0.000000
it really clogs me ... I haven't changed anything with c, d and y - why am I getting this? I am using gcc on linux
source share