Hello world/Line printer: Difference between revisions
Content added Content deleted
(→{{header|Tcl}}: More variants) |
(Basic task description) |
||
Line 1: | Line 1: | ||
{{task}} |
|||
Cause a line printer attached to the computer to print a line containing the message <tt>Hello World!</tt> |
|||
=={{header|BASIC}}== |
=={{header|BASIC}}== |
||
Revision as of 07:21, 3 October 2010
Hello world/Line printer
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
Cause a line printer attached to the computer to print a line containing the message Hello World!
BASIC
<lang qbasic>LPRINT "Hello World!"</lang>
Batch File
<lang dos>ECHO Hello world!">PRN</lang>
Tcl
On Unix only: <lang tcl>exec lp << "Hello World!"</lang> or <lang tcl>set f [open |lp w] puts $f "Hello World!" close $f</lang> On Windows only: <lang tcl>set f [open prn w] puts $f "Hello World!" close $f</lang>
UNIX Shell
<lang bash>echo 'Hello World!'|lp</lang>