📜  cobol hello world - Cobol (1)

📅  最后修改于: 2023-12-03 15:30:02.151000             🧑  作者: Mango

COBOL Hello World

COBOL is a programming language that has been in use since 1959. It is especially popular in business and finance industries . In this example, we will show you how to write "Hello, World!" in COBOL.

Code Explanation

Below is the code for our COBOL "Hello, World!" program:

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
    DISPLAY "Hello, World!".
    STOP RUN.

Let's go over these lines of code:

  • IDENTIFICATION DIVISION.: This is the first line of a COBOL program that identifies the type of program it is.
  • PROGRAM-ID. HELLO-WORLD.: This line is the name of the program.
  • PROCEDURE DIVISION.: This line is the start of the program's main logic.
  • DISPLAY "Hello, World!".: This line tells the program to display "Hello, World!" on the screen.
  • STOP RUN.: This line tells the program to stop running.
Conclusion

COBOL may not be as popular as other programming languages today, but it still plays an important role in the business industry. Hopefully, this guide has helped you understand how to create a basic "Hello, World!" program in COBOL.

If you're interested in learning more about this classic programming language, be sure to check out online resources.