Control Instructions - Point Out Errors :: Discussion


6.Point out the error, if any in the program?
A.Error: No default value is specified
B.Error: Constant expression required at line case P:
C.Error: There is no break statement in each case.
D.No error
Answer:  Option  B
Explanation:

The compiler will report the error "Constant expression required" in the line case P: . Because, variable names cannot be used with case statements.

The case statements will accept only constant expression.

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