Question: Consider the following program with only the variable declarations shown. For each statement below, specify whether it is true or false and explain why. int
Consider the following program with only the variable declarations shown. For each statement below, specify whether it is true or false and explain why.
int x;
void alpha(int a){
int b;
}
void beta() {
static int k;
}
void gamma(int x) {
}
int main(){
int x, y, z;
{
int y, z;
}
}
1. Function alpha can access the external variable x
2. Function main has access to the static variable k declared inside function beta
3. In the inner block of the main function, the block variable y hides the local main variable y
4. Function beta is the only function that can access global variable x
5. In function main, local variable x is not accessible inside the inner block
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
