PRF192_-_SU_2024_-_FE_2315.webp
hoangha297

PRF192_-_SU_2024_-_FE_2315.webp

Kizspy | Question: 10
(Choose 1 answer)
Given the following code snippet:
#include <stdio.h>//Line 1
void someFunction() { //Line 2
int localVar = 10;
//Line 3
printf("%d ", localVar);//Line 4
} main() { int
//Line 5
//Line 6
//Line 7
someFunction();
", localVar); //Line 8
printf("%d return 0;
//Line 9
//Line 10
What happens when attempting to access a local variable outside its scope in C?
A. The program will cause a compilation error at line 8
B. The program crashes at runtime due to an undefined variable.
C. The variable's value becomes zero when accessed outside its scope.
D. The program displays the variable's last value even outside its scope.

Thông tin

Category
PRF192
Thêm bởi
hoangha297
Ngày thêm
Lượt xem
3,749
Lượt bình luận
5
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom