PRF192_-_SU_2024_-_FE_2315.webp
hoangha297

PRF192_-_SU_2024_-_FE_2315.webp

Kizspy | Question: 4
(Choose 1 answer)
Given the following code snippet:
#include <stdio.h>
int main() { int a = 5;
{
int b = 10;
printf("%d ", a);
} Uncommenting the line of code below will be a compilation error.
// printf("%d", b);return 0;
Which of the following best describes the scope of a variable declared inside a block in C?
}
A. The variable b can be accessed only inside the inner block where it's declared.
B. The variable b can be accessed anywhere within main() after its declaration.
C. Both variables a and b can be accessed inside the inner block.
D. The variable b can be accessed globally throughout the program.

Thông tin

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

Share this media

Back
Bên trên Bottom