21.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 0;
    while (i < 2)
    {
        l1: i++;
        while (j < 3)
        {
            printf("loop\n");
            goto l1;
        }
    }
}

22.
What will be the correct syntax for running two variable for loop simultaneously?

24.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    do
        printf("In while loop ");
    while (0);
        printf("After loop\n");
}

25.
What will be the output of the following C code? (Assuming that we have entered the value 2 in the standard input)
#include <stdio.h>
void main()
{
    int ch;
    printf("enter a value between 1 to 2:");
    scanf("%d", &ch);
    switch (ch)
    {
       case 1:
          printf("1\n");
          break;
          printf("hi");
       default:
          printf("2\n");
    }
}

26.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    switch (printf("Do"))
    {
       case 1:
          printf("First\n");
          break;
       case 2:
          printf("Second\n");
          break;
       default:
          printf("Default\n");
          break;
    }
}

30.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    while ()
        printf("In while loop ");
    printf("After loop\n");
}

Read More Section(Control Structures)

Each Section contains maximum 100 MCQs question on Control Structures. To get more questions visit other sections.