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;
}
}
The loop can best be categorized as a:
a. counter-controlled loop
b. sentinel-controlled loop
c. state-controlled loop
d. flag-controlled loop
e. none of the above
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'.