What does the following code write to the monitor?
#include <stdio.h>
int main( void )
{
int a=1 ;
printf("scope m: a=%d\n", a );
if ( a )
{
int b = 2;
printf("scope 1: a=%d\tb=%d\n", a, b );
if ( b )
{
int c = 3;
printf("scope 2: a=%d\tb=%d\tc=%d\n", a, b, c );
a = b = c = 99;
printf("scope 2: a=%d\tb=%d\tc=%d\n", a, b, c );
}
printf("scope 1: a=%d\tb=%d\n", a, b );
}
printf("scope m: a=%d\n", a );
return 0 ;
}
This puzzle is not particularly tricky (like the last one). Just routine application of the rules will do.