1.

What values does uninitialized automatic variables contain?(a) Null value(b) Void value(c) Undefined/Garbage(d) Zero valueI have been asked this question in homework.Query is from Automatic Variable in section Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

The correct OPTION is (c) Undefined/GARBAGE

The best I can explain: The automatic variable which are not initialized, contain garbage value. If we just DECLARE a variable and TRY to print its value, the RESULT is some unknown value. The value is garbage as that was not expected value.



Discussion

No Comment Found

Related InterviewSolutions