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

Q241.
What is correct about the given program?

#include <stdio.h>
int x;
void main()
{
    if (x);
    else
        printf("Else");
}
Discuss
Answer: (b).else block will be executed
Q242.
What is the output of this program?
#include <stdio.h>
int main()
{
    int a = 5;
    if (a == 6); a = 0;
    if (a == 5)
    a++;
    else a += 2;
    printf("%d", a);
    return 0;
}

a.

6

b.

8

c.

5

d.

2

Discuss
Answer: (d).2
Q243.
What is the output of this program?
    #include <stdio.h>
    int main()
    {
        int a = 1, b = 0;
        int c = (a++, b++) ? b : a;
        printf("%d", c);
        return 0; 
    }

a.

2

b.

1

c.

0

d.

3

Discuss
Answer: (a).2
Q244.
What is the output of this program?
int main()
{
 
    int a = 1, b = 0;
    int c = a%2 ? a++ : a-- ? a=0 : ++b ? b = 2 : b++ ;
    printf("%d", c);
    return 0;
}

a.

1

b.

2

c.

3

d.

0

Discuss
Answer: (a).1
Q245.
What will be the output of the program in 16 bit platform ?
#include <stdio.h>
int main()
{
 
    int a=2, b=1, c=2;
    switch(a)
    {
        case b:
        printf("You are in b ");
        break;
        case c:
        printf("You are in c ");
        break;
        default:printf("You are in default");
    }
    return 0;
}
Discuss
Answer: (d).Compilation Error
Q246.
What will be output when you will execute following c code?
#include <stdio.h>
int main()
{
 
    int a=2;
    switch(a,a+1)
    {
        case 2:
            printf("You are in b ");
            break;
        case 3:
            printf("You are in c ");
            break;
        default:
            printf("You are in default");
    }
    return 0;
}
Discuss
Answer: (b).You are in c
Q247.
What is the output of this program?
#include <stdio.h>
void main() {
    float a = 0.7;
    if ( a < 0.7 )
        printf( "Yes" );
    else
        printf( "No" );
}
Discuss
Answer: (a).Yes
Q248.
What is the output of this program?
#include <stdio.h>
void main()
{   char a=0;
    for(a=0;a<=127;a++)
    {
        printf("%d ",a);
    }
}
Discuss
Answer: (b).0 1 2 ... infinite times
Q249.
How many times the loop will execute ?
for(int i = 0 ; i < 10 ; i++)
{
    i  =  i*2;
    i--;
}
Discuss
Answer: (d).Infinite
Q250.
What is the output of this program?
#include <stdio.h>
void main()
{
  int j = -5;
  for(;j;printf("%d ", j++));
}
Discuss
Answer: (a).-5 to -1

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!