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

32.
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;
        }
    }
}

35.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    for (int i = 0;i < 1; i++)
        printf("In for loop\n");
}

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

38.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 0;
    for (i; i < 2; i++){
        for (j = 0; j < 3; j++)
        {
            printf("1\n");
            break;
        }
        printf("2\n");
    }
    printf("after loop\n");
}

39.
Comment on the output of the following C code.
#include <stdio.h>
int main()
{
    int a = 1;
    switch (a)
    case 1:
        printf("%d", a);
    case 2:
        printf("%d", a);
    case 3:
        printf("%d", a);
    default:
        printf("%d", a);
}

40.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int a = 1, b = 1;
    switch (a)
    {
       case a*b:
          printf("yes ");
       case a-b:
          printf("no\n");
          break;
    }
}

Read More Section(Control Structures)

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