C Programming :: Declarations and Initializations - Discussion
Home > C Programming > Declarations and Initializations > MCQs Questions Discussion
19 / 54
Choose the correct option.
The value of an automatic variable that is declared but not initialized will be
A0
B'-1
Cgarbage
Dnone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
Whenever a variable is declared as automatic variable, the variable by default will contain garbage values, whether it is initialized or not, hence the correct option is C.
Read Full Answer
Report Error
Please Login First Click Here
SHORTCUT
C language has 4 storage classes and these Storage classes will have below values when it is declared but not initialized.
auto | garbage |
static | zero |
extern | zero |
register | garbage |
Read Full Answer
Report Error
Please Login First Click Here
STEP-BY-STEP
Until and unless it is not initialised it will contain garbage value only.
Read Full Answer
Report Error
Please Login First Click Here