02.02.2014, 00:12
It gives the reminder.
pawn Код:
new
a = 10,
b = 2;
printf("The reminder while dividing 10/2 is %d", a%b);
//Outputs 0
a = 3, b = 2;
printf("The reminder while dividing 3/2 is %d", a%b);
//Outputs 1
//A function example, whether if a number is odd or even.
stock bool:IsNumberOdd(number) {
if((number % 2) == 0) return false;
else return true;
}
Returns true if the number is odd, false if it's even.