How many times will the word Hello be printed?

You execute the following code.

How many times will the word Hello be printed?

You execute the following code.

How many times will the word Hello be printed?

A.
49

B.
50

C.
51

D.
100

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).



Leave a Reply 2

Your email address will not be published. Required fields are marked *


mandisa

mandisa

B is the correct answer

DB7

DB7

B: 50
i tried it, first iteration 0 % 2 = 0, thus does not get printed to console