Puzzle SL4


Rule 4

Will the following program compile without errors?

#include <stdio.h>
int main( void )
{
  int a = 1;
  int b = 2;
  
  {
    int b = 3;
    int c = 4;
    printf("a=%d\tb=%d\tc=%d\n", a, b, c );
  }
  
  {
    int a = 4;
    printf("a=%d\tb=%d\tc=%d\n", a, b, c );
  }

  return 0;
}

Hint: consider the identifier c.



Previous Page        Answer         Next Page         Home