Archived

This topic is now archived and is closed to further replies.

Nibbles

is X divisible by 10?

Recommended Posts

Nibbles    569
Hi, how do I check to see if X is divisible by 10? I assume I need the % operation, however I''m not too good with it. Thanks Scott Email Website
"If you try and don''t succeed, destroy all evidence that you tried."

Share this post


Link to post
Share on other sites
quote:
Original post by wojtos
Hi, how do I check to see if X is divisible by 10? I assume I need the % operation, however I''m not too good with it.



The modulus (%) operator returns the remainder. Ex. a % b returns the remainder of a/b. If the remainder is zero (a % b == 0) then then a is divisible by b.

Share this post


Link to post
Share on other sites
Peon    276
One thing that might be totally obvious (to me anyway) is that 4%5 would be 4... just something to remember

Share this post


Link to post
Share on other sites