PRF192_-_SU_2024_-_Block_5_-_FE_2675.webp
R

PRF192_-_SU_2024_-_Block_5_-_FE_2675.webp

Kizspy | Question: 6
(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.
FUOVER

Thông tin

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

Share this media

Back
Bên trên Bottom