Variables
1. What is a variable in C?
a) A constant value
b) A name given to a memory location
c) A loop
d) A function
Answer: b) A name given to a memory location
2. Which of the following is a valid variable name?
a) 1stvalue
b) total%
c) total_value
d) int
Answer: c) total_value
3. What will be the value of an uninitialized local variable?
a) 0
b) NULL
c) Garbage value
d) -1
Answer: c) Garbage value
4. Which keyword is used to declare a variable in C?
a) dim
b) var
c) int
d) declare
Answer: c) int
5. How many times can a variable be declared in a scope?
a) Only once
b) Twice
c) Any number of times
d) Never
Answer: a) Only once
6. Which of the following is not a valid variable type?
a) int
b) float
c) real
d) char
Answer: c) real
7. What is the default storage class of a variable?
a) auto
b) static
c) register
d) extern
Answer: a) auto
8. Which variable type can store a single character?
a) int
b) float
c) char
d) double
Answer: c) char
9. Which of the following is NOT a correct variable name in C?
a) total1
b) _count
c) value#1
d) result
Answer: c) value#1
10. Can variable names start with an underscore in C?
a) Yes
b) No
Answer: a) Yes