The output of the following Code:
- 10 11 12 13 14
- 10 10 10 10 10
- 10
- 0 1 2 3 4 5
- Error
Answer:
2. 10 10 10 10 10
Explanation:
The default storage class of the local variable is auto. The scope of auto variables is blocked in which it has been declared. When program control goes out of the scope auto variables are dead. So variable I which has been declared inside for loop has scope within a loop and in each iteration, the variable is dead and re-initialized.
0 comments:
Post a Comment