![]() |
Simple. What are the commands in C++ equivalent in function to Pascal MOD and DIV commands? I need this little detail for a program of mine...
|
Mod is the percentage sign - %
I don't know if there is one for div, but you can just use the / operator, then disregard the fractional part. |
If DIV is division (I don't know Pascal, so I'm just going on the shape of the word), you just use / for divisions.
E.G. x = 10; x = x/5; print x; OUTPUT: 2 |
Operator / concerning two integers returns an integer.
Expresions: 19/5=3; 19/(5.0)= 3.8; |
yeps
Code:
19/5 = 3 |
Thanks people. You're real lifesavers...
|
The current time is 07:12 PM (GMT) |
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.