C
Chad
The questions are about the following lines of C code..
#include <stdio.h>
int x = 3;
int main(void)
{
printf("The value of x is: %d\n", x);
{
int x = 25;
printf("The value of x is now : %d\n", x);
}
printf("The value of x again is: %d\n", x);
return 0;
}
When I run it, I get....
The value of x is: 3
The value of x is now : 25
The value of x again is: 3
So what gets changed? The (value of the) object (named 'x')? Or does
'x' itself change? Also, would 'x' be considered an identifier?
#include <stdio.h>
int x = 3;
int main(void)
{
printf("The value of x is: %d\n", x);
{
int x = 25;
printf("The value of x is now : %d\n", x);
}
printf("The value of x again is: %d\n", x);
return 0;
}
When I run it, I get....
The value of x is: 3
The value of x is now : 25
The value of x again is: 3
So what gets changed? The (value of the) object (named 'x')? Or does
'x' itself change? Also, would 'x' be considered an identifier?