161k views
0 votes
What is the output of this line of code? print(25%5)

A.
0

B.
5

C.
1

D.
25

User Mlvljr
by
8.6k points

1 Answer

4 votes

Answer:

A. 0

What is the Explanation?

Since we are doing 25 % 5, we are trying to figure out the last time number 2 fits into number 1. Therefore, 5 fits into 25 pefectly. Let me give you another example, if it was 7 % 4 the answer would be 3 because 4 can fit once, then when it tries to fit another time it can only put 3 into the 7.

Hope that helps.

User Bryan Porter
by
8.7k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.