Microsoft
98-361 · Question #44
You execute the following code. How many times will the word Hello be printed?
The correct answer is B. 50. The % operator computes the remainder after dividing its first operand by its second. All numeric types have predefined remainder operators. In this case the reminder will be nonzero 50 times (for i with values 1, 3, 5,..,99).
Understanding Core Programming
Question
You execute the following code. How many times will the word Hello be printed?
Options
- A49
- B50
- C51
- D100
How the community answered
(43 responses)- A12% (5)
- B77% (33)
- C7% (3)
- D5% (2)
Explanation
The % operator computes the remainder after dividing its first operand by its second. All numeric types have predefined remainder operators. In this case the reminder will be nonzero 50 times (for i with values 1, 3, 5,..,99).
Topics
#loops#iteration count#for loop#loop bounds
Community Discussion
No community discussion yet for this question.