Control Instructions - Point Out Errors Multiple Questions and Answers.




1.Point out the error, if any in the for loop.
A. There should be a condition in the for loop
B. The two semicolons should be dropped
C. The for loop should be replaced with while loop.
D. No error

2.Point out the error, if any in the program?
A. Error: No case statement specified
B. Error: No default specified
C. No Error
D. Error: infinite loop occurs

3.Point out the error, if any in the program.
A. Error: No default specified
B. No Error and prints "Case1"
C. Error: Invalid printf statement after switch statement
D. None of above

4.Point out the error, if any in the while loop?
A. There should be a condition in the while loop
B. There should be at least a semicolon in the while
C. The while loop should be replaced with for loop.
D. Error

5.Which of the following errors would be reported by the compiler on compiling the program given below?
A. There is no break statement in each case.
B. Expression as in case 3 + 2 is not allowed.
C. Duplicate case case 5:
D. None of above

»



Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers