Jump to content

Hello world/Text: Difference between revisions

No edit summary
Line 765:
display "Hello world!".
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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.