Listing 3

/* Write to a printer -- the correct way */

#include <stdio.h>

function()
        {
        FILE *file_printer; /* pointer to a file */
        int x, y, z;

        x = 5;
        y = y;
        z = x + y;

        /*  open the printer */
        file_printer = fopen ("PRN", "w");

        /*  print the line */
        fprintf (file_printer, "The answer is %10d", z);

        /* close the printer */
        fclose (file_printer);
        }