Multiple choice

What would be the output of the following 'C' statement?

void main()
{
int i=1, j=5;
while(i<j)
{
printf("value of i= %d", i);
i++;
}
}

  1. value of i=1value of i=2value of i=3value of i=4

  2. Value of i=1value of i=2value of i=3value of i=4value of i=5

  3. Value of i=1value of i=4

  4. Value of i=1value of i=5

  5. Value of i=1value of i=3value of i=4

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is the correct output of the 'C' statement as in the while statement until the condition becomes false the value of 'i' will be printed on the screen.