Control Structures MCQs

155 questionsC-ProgramPage 15 of 18

Practice free Control Structures multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 155 questions — no login required.

Question 127easy
Which datatype can accept the switch statement?
Question 128medium
Which loop is most suitable to first perform the operation and then test the condition?
Question 129medium
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int k = 0;
    for (k)
        printf("Hello");
}
Advertisement
Question 130hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    while ()
        printf("In while loop ");
    printf("After loop\n");
}
Question 131hard
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;
        }
    }
}
Question 132hard
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;
        }
    }
}
Advertisement
Question 133easy
What is an example of iteration in C?
Question 134hard
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int i = 5, k;
    if (i == 0)
        goto label;
        label: printf("%d", i);
        printf("Hey");
}
Question 135hard
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");
}