Homework #1 -- Due September 7

First, compile the following program on one of the Digital workstations.

    main (int argc, char *argv[])
    {
      int i ;
      char c[2] = { 'A', '\n' } ;
      for (i=0; i<3; ++i)
        {
         if (fork()==0)
            ++c[0] ;
         else if (argc==2)
            (void) wait((int *)0) ;
         write(1, &c, 2) ;
        }
    }

Run the program, without giving it an argument, five times and examine its output. Then run the program five times with a single argument.

Now write a paragraph explaining the behavior of the program.