Questions 15-17 refer to the following program segment:
int i = 0, g = 0, s = 0, t= 0, z = 0;
string sValue;
while (i < 5)
{
inValue = Console.ReadLine( );
t = Convert.ToInt32(inValue);
s = s + t;
if (t > -1)
g = g + 1;
else
z = z + 1;
i = i + 1;
}
}
How many times is the loop body of the while statement executed?
a. once
b. never
c. four times
d. five times
e. until a number 5 or larger is entered
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.