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