adplus-dvertising

Welcome to the Control Flow Statements in C MCQs Page

Dive deep into the fascinating world of Control Flow Statements in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Control Flow Statements in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Control Flow Statements in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Control Flow Statements in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Control Flow Statements in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Control Flow Statements in C MCQs | Page 6 of 32

Q51.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        while ()
            printf("In while loop ");
        printf("After loop\n");
    }
Discuss
Answer: (c).Compile time error
Q52.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        do
            printf("In while loop ");
        while (0);
            printf("After loop\n");
    }
Discuss
Answer: (b). In while loop after loop
Q53.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int i = 0;
        do {
            i++;
            printf("In while loop\n");
        } while (i < 3);
    }
Discuss
Answer: (a).In while loop In while loop In while loop
Q54.
How many times i value is checked in the below code?
#include <stdio.h>
    int main()
    {
        int i = 0;
        do {
            i++;
            printf("in while loop\n");
        } while (i < 3);
    }

a.

2

b.

3

c.

4

d.

1

Discuss
Answer: (b).3
Q55.
How many times i value is checked in the below code?
#include <stdio.h>
    int main()
    {
        int i = 0;
        while (i < 3)
            i++;
        printf("In while loop\n");
    }

a.

2

b.

3

c.

4

d.

1

Discuss
Answer: (c).4
Q56.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        int i = 2;
        do
        {
            printf("Hi");
        } while (i < 2)
    }
Discuss
Answer: (a).Compile time error
Q57.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        int i = 0;
        while (++i)
        {
            printf("H");
        }
    }
Discuss
Answer: (b).H is printed infinite times
Q58.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        int i = 0;
        do
        {
            printf("Hello");
        } while (i != 0);
    }
Discuss
Answer: (c).Hello
Q59.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        char *str = "";
        do
        {
            printf("hello");
        } while (str);
    }
Discuss
Answer: (d).Hello is printed infinite times
Q60.
What is the output of this C code?
#include <stdio.h>
void main()
{
    int i = 0;
    while (i < 10)
    {
        i++;
        printf("hi\n");
        while (i < 8) 
        {
            i++;
            printf("hello\n");
        }
    }
}
Discuss
Answer: (d).Hi is printed once, hello 7 times and then hi 2 times
Page 6 of 32

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!