Home Subjects C Programming Control Flow

C Programming
Control Flow

C language from basics to advanced placement prep

52 Q 10 Topics Take Mock Test
Advertisement
Difficulty: All Easy Medium Hard 51–52 of 52
Topics in C Programming
Q.51 Medium Control Flow
What is the output?
for (int i = 1; i
A 1 2
B 1 2 3
C 1 2 3 4 5
D 2 3 4
Correct Answer:  A. 1 2
EXPLANATION

When i becomes 3, break is executed, exiting the loop. So only 1 and 2 are printed.

Test
Q.52 Medium Control Flow
What will be printed?
int x = 0;
if (x = 5)
printf("True");
else
printf("False");
A True
B False
C Compilation error
D Undefined behavior
Correct Answer:  A. True
EXPLANATION

x = 5 assigns 5 to x and evaluates to 5 (non-zero), which is true. So 'True' is printed.

Test
IGET
IGET AI
Online · Exam prep assistant
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips