MCQ Mojo
access_time
menu
Quiz
Web Stories
CBSE
arrow_drop_down
MCQ Questions for CBSE Class 12 with Answers
MCQ Questions for CBSE Class 11 with Answers
MCQ Questions for CBSE Class 10 with Answers
MCQ Questions for CBSE Class 9 with Answers
MCQ Questions for CBSE Class 8 with Answers
MCQ Questions for CBSE Class 7 with Answers
MCQ Questions for CBSE Class 6 with Answers
MCQ Questions for CBSE Class 5 with Answers
MCQ Questions for CBSE Class 4 with Answers
MCQ Questions for CBSE Class 3 with Answers
MCQ Questions for CBSE Class 2 with Answers
MCQ Questions for CBSE Class 1 with Answers
CBSE
arrow_drop_down
MCQ Questions for CBSE Class 12 with Answers
MCQ Questions for CBSE Class 11 with Answers
MCQ Questions for CBSE Class 10 with Answers
MCQ Questions for CBSE Class 9 with Answers
MCQ Questions for CBSE Class 8 with Answers
MCQ Questions for CBSE Class 7 with Answers
MCQ Questions for CBSE Class 6 with Answers
MCQ Questions for CBSE Class 5 with Answers
MCQ Questions for CBSE Class 4 with Answers
MCQ Questions for CBSE Class 3 with Answers
MCQ Questions for CBSE Class 2 with Answers
MCQ Questions for CBSE Class 1 with Answers
Quiz
Quiz
/
Programming Gate & PSU MCQ Questions With Answers
1.
What will be the output of the following C code? #include
int main() { do{ printf("In while loop "); }while (0); printf("After loop\n"); }
In while loop
In while loop after loop
After loop
Infinite loop
2.
What is the output of C Program.?int main() { int a=25; while(a <= 27) { printf("%d ", a); a++; } return 0; }
25 25 25
25 26 27
27 27 27
Compiler error
3.
What is the output of C Program.? int main() { int a=32; do { printf("%d ", a); a++; if(a > 35) break; }while(1); return 0; }
No Output
32 33 34
32 33 34 35
Compiler error
4.
Choose a correct C Statement.
a++ is (a=a+1) POST INCREMENT Operator
a-- is (a=a-1) POST DECREMENT Operator--a is (a=a-1) PRE DECREMENT Operator
++a is (a=a+1) PRE INCREMENT Operator
All the above.
5.
Choose a correct C do while syntax.
dowhile(condition) { //statements }
do while(condition) { //statements }
do { //statements }while(condition)
do { //statements }while(condition);
6.
Loops in C Language are implemented using.?
While Block
For Block
Do While Block
All the above
7.
What is the output of C Program.?int main() { int a=32; do { printf("%d ", a); a++; }while(a <= 30); return 0; }
32
33
30
No Output
8.
What is the output of C Program.?int main() { int a=5; while(a >= 3); { printf("RABBIT\n"); break; } printf("GREEN"); return 0; }
GREEN
RABBIT GREEN
RABBIT is printed infinite times
None of the above
9.
In the following loop construct, which one is executed only once always. for(exp1; exp2; exp3)
exp1
exp3
exp1 and exp3
exp1,exp2 and exp3
10.
The continue statment cannot be used with
for
while
do while
switch
11.
What is the output of C Program.? int main() { int k; for(;;) { printf("TESTING\n"); break; } return 0; }
No Output
TESTING
Compiler error
None of the above
12.
What is the output of C Program.? int main() { int k; for(k=1; k <= 5; k++); { printf("%d ", k); } return 0; }
1 2 3 4 5
1 2 3 4
6
5
13.
Choose a right C Statement.
Loops or Repetition block executes a group of statements repeatedly.
Loop is usually executed as long as a condition is met.
Loops usually take advantage of Loop Counter
All the above.
14.
What is the way to suddenly come out of or Quit any Loop in C Language.?
continue; statement
break; statement
leave; statement
quit; statement
15.
What is the output of C Program.?
GREEN
RABBIT GREEN
RABBIT is printed unlimited number of times.
Compiler error.
Report Question
Previous
Next
warning
Submit
access_time
Time
Report Question
A bunch of text
Support mcqmojo.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page