C- Declarations and Initializations Questions and Answers
Practice ModeShowing 10 of 49 questions
Q41
What is the return type of malloc() function?
Answer: Option B
Explanation: malloc returns void pointer which can be cast to any type.
Q42
Which operator is used to get the address of a variable?
Answer: Option C
Explanation: Ampersand gives the memory address of a variable.
Q43
What is the value of an uninitialized local variable?
Answer: Option C
Explanation: Local variables contain garbage values if not initialized.
Q44
Which is used for logical NOT operation?
Answer: Option C
Explanation: Exclamation mark is the logical NOT operator.
Q45
What is the format specifier for double?
Answer: Option C
Explanation: %lf is used for double in printf/scanf.
Q46
Which header file is needed for printf()?
Answer: Option B
Explanation: stdio.h contains declaration for standard I/O functions.
Q47
What is the scope of a local variable?
Answer: Option B
Explanation: Local variables are accessible only within their block.
Q48
Which is the correct way to declare a function?
Answer: Option B
Explanation: Function declaration includes return type and parameters.
Q49
What does "auto" storage class indicate?
Answer: Option B
Explanation: Auto is default for local variables with automatic storage.