Control Instructions - Point Out Errors :: Discussion


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
Answer:  Option  B
Explanation:

switch(i) becomes switch(1), then the case 1: block is get executed. Hence it prints "Case1".

printf("This is c program."); is ignored by the compiler.

Hence there is no error and prints "Case1".

Tutorial Link:
Published by:Michael Daani

Comments are not available

Post your comments here:

Optional

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