Which of the following for statements would be executed the same number of times
as the following while statement?
int num = 10;
while(num > 0)
{
Console.WriteLine(num);
num--;
}
a. for (num = 0; num < 10; num++)
b. for (num = 1; num < 10; num++)
c. for (num = 100; num == 10; num+=10)
d. for (num = 10; num < 0; num--);
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'.