Here is a listing of online C test questions on “Automatic Variables” along with answers, explanations and/or solutions:
1. Automatic variables are variables that are
a) Declared within the scope of a block, usually a function
b) Declared outside all functions
c) Declared with auto keyword
d) Declared within the keyword extern
2. Automatic variables
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) Only 1
3. Automatic variables are allocated memory in
b) Data segment
c) Code segment
4. What is the output of this C code?
here x is
a) automatic variable
b) static variable
c) register variable
d) global variable.
5. Automatic variables are initialised to
b) Junk value
d) Both Zero & Junk value
6. Which of the following storage class supports char data type?
d) all of the mentioned
7. The variable declaration with no storage class specified is by default:
Sanfoundry Global Education & Learning Series – C Programming Language.
To practice all features of C programming language, here is complete set of 1000+ Multiple Choice Questions and Answers on C.