mod function on C?

DAM

Diamond Member
Jan 10, 2000
6,102
1
76
whats the mod function in C and whats the syntax?



for all you who dont know, the mod is the remainder of a number being devided.



thanks.



dam()
 

poop

Senior member
Oct 21, 1999
827
0
0
2

do it like this

12/5 = 2.4, right?

Well, you remove the integer and get .4 left.

.4 * 5 = 2, the remainder. At least that is how you do it in code. Most people just look at it and see that 10 is divisible by five, so 12-10=2.