home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_10 / 8n10086b < prev    next >
Text File  |  1990-07-22  |  531b  |  29 lines

  1.  
  2. *******Listing 3
  3.  
  4. /* Write to a printer -- the correct way */
  5.  
  6. #include <stdio.h>
  7.  
  8. function()
  9.           {
  10.           FILE *file_printer; /* pointer to a file */
  11.           int x, y, z;
  12.  
  13.           x = 5;
  14.           y = y;
  15.           z = x + y;
  16.  
  17.           /* open the printer */
  18.           file_printer = fopen ("PRN", "w");
  19.  
  20.           /* print the line */ 
  21.           fprintf (file_printer, "The answer is %10d", z);
  22.  
  23.           /* close the printer */
  24.           fclose (file_printer);
  25.           }
  26.  
  27. *********
  28.  
  29.