Hello world/Text: Difference between revisions

Content added Content deleted
No edit summary
Line 765: Line 765:
display "Hello world!".
display "Hello world!".
stop run.</lang>
stop run.</lang>

Using relaxed compilation rules, the hello program can become a single DISPLAY statement.
{{works with|GnuCOBOL}}

<lang cobol>display"Hello, world".</lang>

<pre>prompt$ cobc -x -frelax-syntax -free hello.cob
hello.cob: 1: Warning: PROGRAM-ID header missing - assumed
hello.cob: 1: Warning: PROCEDURE DIVISION header missing - assumed

prompt$ ./hello
Hello, world</pre>

''Note how COBOL can handle the DISPLAY reserved word without a space before the quoted string, the quote being a compile time scan delimiter. The full stop period after the single statement is still mandatory, at least for GnuCOBOL and a clean compile to executable.''


=={{header|Cobra}}==
=={{header|Cobra}}==