Un-conditional MCQ
Q1) Which are not looping structures?
- For loop
- While loop
- do Do...while loop
- if…else
Answer:- (D).
for(i=1;i<=50;i++) printf(“Hello”);
- 1
- 50
- Zero
- None of them
Answer:- (B).
- Step value of loop
- Value of the counter variable
- Condition statement
- None of the above
Answer:- (B).
- goto
- for
- do-while
- if-else
Answer:- (A).
- Breaks loop and goes to next statement after loop
- does not break loop but starts new iteration
- exits the program
- Starts from beginning of program
Answer:- (B).
void main(); { int i = 32766; while (i<= 32767) { printf("%d\n",i); i = i + 1; } }
- 2 times
- 1 times
- infinite times
- loop will not be executed
Answer:- (A).
void main() { int i; for(i=1; i<=10;i++); printf(“%d\n”,i); }
- 10
- 1 to 10
- 11
- None of the above
Answer:- (C).
void main() { int i; for(i=65;i<70;i++) printf(“%c,”,i); }
- 65,66,67,68,69,70
- a,b,c,d,e,
- A,B,C,D,E,
- A,B,C,D,E
Answer:- (C).
void main() { int i=5; switch(i) { case 3: printf(“three”); case 4: printf(“four”); case 5: printf(“five”); case 6: printf(“six”);break; case 7: printf(“seven”); default: printf(“default”); } }
- five
- fivesixsevendefault
- fivesix
- None of the above
Answer:- (C).
void main() { int num=10; if(num) printf("If Executed"); else printf("Else Executed"); }
- If Executed
- Else Executed
- Error
- Blank
Answer:- (A).
Copyright © 2022 Shineskill Software Pvt. Ltd., All rights reserved.