Hello world/Line printer: Difference between revisions

Content added Content deleted
Line 40:
 
=={{header|C}}==
Assuming that the line printer is attached to /dev/lp0
{{incorrect|C|It prints to standard out rather than to a line printer.}}
<lang C>#include <stdio.h>
 
int main()
{
FILE *lp;
printf("Hello world!\n");
lp = fopen("/dev/lp0","w");
printffprintf(lp,"Hello world!\n");
fclose(lp);
return 0;
}</lang>