This set of C Multiple Choice Questions & Answers (MCQs) focuses on “Automatic Variables – 2”.
Pre-requisite for this C MCQ set: Advanced C Programming Video Tutorial.
1. Automatic variables are _________
a) Declared within the scope of a block, usually a function
b) Declared outside all functions
c) Declared with the auto keyword
d) Declared within the keyword extern
View Answer
Explanation: None.
2. What is the scope of an automatic variable?
a) Exist only within that scope in which it is declared
b) Cease to exist after the block is exited
c) Exist only within that scope in which it is declared & exist after the block is exited
d) All of the mentioned
View Answer
Explanation: None.
3. Automatic variables are allocated memory in ___________
a) heap
b) Data segment
c) Code segment
d) stack
View Answer
Explanation: None.
4. What will be the x in the following C code?
#include <stdio.h>
void main()
{
int x;
}
a) automatic variable
b) static variable
c) register variable
d) global variable
View Answer
Explanation: None.
5. Automatic variables are initialized to ___________
a) Zero
b) Junk value
c) Nothing
d) Both Zero & Junk value
View Answer
Explanation: None.
6. Which of the following storage class supports char data type?
a) register
b) static
c) auto
d) all of the mentioned
View Answer
Explanation: None.
7. A local variable declaration with no storage class specified is by default _________
a) auto
b) extern
c) static
d) register
View Answer
Explanation: None.
Sanfoundry Global Education & Learning Series – C Programming Language.
To practice all areas of C language, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Computer Science Books
- Apply for Computer Science Internship
- Check C Books
- Watch Advanced C Programming Videos
- Practice Computer Science MCQs