Back to questions
JuniorTheoryCommon
What does the program print (lines separated by spaces)?
Сообщить(19 % 5);
Сообщить(Цел(19 / 5));
Сообщить(Цел(-7 / 2));4 3 -3
- Expecting
Целto round 3.8 up to 4:Целdoes not round, it drops the fraction - Expecting
Цел(-3.5)to give-4, as rounding down would:Целdrops the fraction toward zero and gives-3
- Which function rounds
-3.5to-4, and why? - How do you count full boxes and leftover pencils with
Целand%?