2.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int i = 0;
    if (i == 0)
    {
        printf("Hello");
        break;
    }
}

3.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int x = 0;
    if (x == 0)
        printf("hi");
    else
        printf("how are u");
        printf("hello");
}

5.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int i = 0, k;
    if (i == 0)
        goto label;
        for (k = 0;k < 3; k++)
        {
            printf("hi ");
            label: k = printf("%03d", i);
        }
}

6.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0, j = 0;
    while (i < 5, j < 10)
    {
        i++;
        j++;
    }
    printf("%d, %d\n", i, j);
}

7.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int x = 5;
    if (true);
        printf("hello");
}

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

9.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int i = 0;
    if (i == 0)
    {
        printf("Hello");
        continue;
    }
}

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

Read More Section(Control Structures)

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