home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / sep91.zip / 9N09102A < prev    next >
Text File  |  1991-07-23  |  475b  |  27 lines

  1.  
  2. /**
  3. Copied and modified from June 1990 CUJ, p 71-72.
  4. */
  5.  
  6. #include <stdio.h>
  7. void main()
  8.     {
  9.      FILE *file_printer;
  10.      int x, y, z;
  11.  
  12.      x = 5;
  13.      y = 6;
  14.      z = x + y;
  15.  
  16.      if ( (file_printer = fopen("LPT1", "w") ) == NULL) 
  17.           {
  18.           printf ("unable to open file".\n");
  19.           exit(0);
  20.           }
  21.      
  22.      fprintf(file_printer, "The answer is %10d.", z);
  23.      fflush(file_printer);
  24.      fclose (file_printer);
  25.      }
  26.  
  27.