edited by
445 views
0 votes
0 votes

consider the following C code 

#define a(x+1)
int x=2;
void b()
{
    x=9;
    printf("%d\n”,a);
}
void c()
{
    int x=1;
    printf("%d\n”,a);
}
void main()
{
   b();
   c();
}

which of the following is true output if dynamic scooping is used 

  1. ) 3,2 
  2. ) 10,2
  3. ) 2,10
  4. ) 9,2

I calculated the right answer but now i want to ask what is the value of global x after the program execution

is it 9 ,10 ??

edited by

Please log in or register to answer this question.

Related questions

2 votes
2 votes
1 answer
3
0 votes
0 votes
1 answer
4
Markzuck asked Jan 10, 2019
523 views
Please explained detialed execution of this code, I am not getting how int stored in char, like we can interchange using ASCII but still cant store right?