Gosh this is such a simple question but dont quite understand the logic. I understand that the modulus operator is represented by '%'. And I understand that the expression x % y produces the remainder when x is divided by y.
So when I divide 74 by 5 the answer is 14.8 . So I thought I should see the answer 8 but instead I see 4. Somebody please explain to me why there is a 4 instead of 8?
[output]
4
[/output]
Code:#include <stdio.h> main() { int it; it = 74 % 5; printf("%d\n", it); }



LinkBack URL
About LinkBacks


