Answer SL11


scope f: a=1    b=2    c=3
scope m: a=77    b=99

#include <stdio.h>

int funct( int a, int b )
{
  int c=3 ;
  printf("scope f: a=%d    b=%d    c=%d\n", a, b, c );
}

int main ( void )
{
  int a=77, b=99;
  
  funct( 1, 2 );
  printf("scope m: a=%d    b=%d\n", a, b );

  return 0 ;
}

Comments: The variables a and b that are declared in main have main's block as their scope. They are unaffected by the parameters a and b, which have a different scope.



Back to Puzzle Home