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 2 of 32

Q11.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int x = 1;
        if (x > 0)
            printf("inside if\n");
        else if (x > 0)
            printf("inside elseif\n");
    }
Discuss
Answer: (a).inside if
Q12.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int x = 0;
        if (x++)
            printf("true\n");
        else if (x == 1)
            printf("false\n");
    }
Discuss
Answer: (b).false
Q13.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int x = 0;
        if (x == 1)
            if (x == 0)
                printf("inside if\n");
            else
                printf("inside else if\n");
        else
            printf("inside else\n");
    }
Discuss
Answer: (c).inside else
Q14.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int x = 0;
        if (x == 0)
            printf("true, ");
        else if (x = 10)
            printf("false, ");
        printf("%d\n", x);
    }
Discuss
Answer: (b).true, 0
Q15.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int x = 0;
        if (x == 1)
            if (x >= 0)
                printf("true\n");
            else
                printf("false\n");
    }
Discuss
Answer: (d).No print statement
Discuss
Answer: (d).none of the mentioned
Q17.
Which of the following is an invalid if-else statement?
Discuss
Answer: (a).if (if (a == 1)){}
Q18.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int a = 1;
        if (a--)
            printf("True");
            if (a++)
                printf("False");
    }
Discuss
Answer: (a).True
Q19.
Comment on the output of this C code?
#include <stdio.h>
    int main()
    {
        int a = 1;
        if (a)
            printf("All is Well ");
            printf("I am Well\n");
        else
            printf("I am not a River\n");
    }
Discuss
Answer: (d).Compile time errors during compilation
Q20.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        if (printf("%d", printf(")))
            printf("We are Happy");
        else if (printf("1"))
            printf("We are Sad");
    }
Discuss
Answer: (d).compile time error
Page 2 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!