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.
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 18 of 32
Explore more Topics under C Programming
#include<stdio.h>
int main()
{
int i = 1;
switch(i)
{
case 1:
printf("Case1");
break;
case 1*2+4:
printf("Case2");
break;
}
return 0;
}
#include<stdio.h>
int main()
{
void fun();
int i = 1;
while(i <= 5)
{
printf("%d\n", i);
if(i>2)
goto here;
}
return 0;
}
void fun()
{
here:
printf("It works");
}
#include<stdio.h>
int main()
{
int a = 10, b;
a >=5 ? b=100: b=200;
printf("%d\n", b);
return 0;
}
#include<stdio.h>
int main()
{
int i = 10, j = 20;
if(i = 5) && if(j = 10)
printf("Have a nice day");
return 0;
}
#include<stdio.h>
int main()
{
int i = 10, j = 15;
if(i % 2 = j % 3)
printf("CompSciBits\n");
return 0;
}
#include<stdio.h>
int main()
{
int x = 30, y = 40;
if(x == y)
printf("x is equal to y\n");
else if(x > y)
printf("x is greater than y\n");
else if(x < y)
printf("x is less than y\n")
return 0;
}
1: Every if-else statement can be replaced by an equivalent statements using ?: operators
2: Nested if-else statements are allowed.
3: Multiple statements in an if block are allowed.
4: Multiple statements in an else block are allowed.
#include<stdio.h>
int main()
{
int i = 0;
i++;
if(i <= 5)
{
printf("CompSciBits\n");
exit(0);
main();
}
return 0;
}
#include<stdio.h>
int main()
{
int x = 10, y = 100%90, i;
for(i=1; i<10; i++)
if(x != y);
printf("x = %d y = %d\n", x, y);
return 0;
}
1 :
The printf() function is called 10 times.
2 :
The program will produce the output x = 10 y = 10
3 :
The ; after the if(x!=y) will NOT produce an error.
4 :
The program will not produce output.
1:
for loop works faster than a while loop.
2:
All things that can be done using a for loop can also be done using a while loop.
3:
for(;;); implements an infinite loop.
4:
for loop can be used if we want statements in a loop get executed at least once.
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!