Const - Point Out Errors :: Discussion


5.Point out the error in the program?
A.Error: unknown data type const int
B.Error: const variable have been initialised when declared.
C.Error: stack overflow in x
D.None of above
Answer:  Option  B
Explanation:

const variable has to be initialized when it is declared. later assigning the value to the const variable will result in an error "Cannot modify the const object".

Hence Option B is correct

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