home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_09 / 9n09102a < prev    next >
Text File  |  1991-07-22  |  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.