C- Declarations and Initializations Questions and Answers
Practice ModeShowing 10 of 49 questions
Q31
What is the size of an int data type in C?
Answer: Option D
Explanation: Size of int is compiler dependent, typically 2 or 4 bytes.
Q32
Which keyword is used to define a constant in C?
Answer: Option C
Explanation: const keyword is used to define read-only variables.
Q33
What is the default value of a static variable in C?
Answer: Option A
Explanation: Static variables are automatically initialized to zero.
Q34
Which of the following is a valid declaration?
Answer: Option C
Explanation: Array size must be positive integer constant.
Q35
What does the "volatile" keyword indicate?
Answer: Option C
Explanation: Volatile tells compiler that variable may change unexpectedly.
Q36
Which storage class has the longest scope?
Answer: Option D
Explanation: Global variables exist throughout program execution.
Q37
What is the output of: printf("%d", sizeof('A'));
Answer: Option A
Explanation: Character constants are of type int in C.
Q38
Which is correct for declaring a pointer?
Answer: Option B
Explanation: Asterisk is used to declare pointer variables.
Q39
What is the maximum length of a C identifier?
Answer: Option A
Explanation: C standard specifies 31 characters for internal identifiers.
Q40
Which is not a fundamental data type in C?
Answer: Option D
Explanation: String is not a fundamental type; it's array of characters.