June 7, 2013 · General · Email This Post

Sponsored Link
COBOL is one of the oldest programming languages, primarily designed by Grace Hopper. Its name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments.

Install COBOL compiler in ubuntu

Open the terminal and run the following comamnd

sudo apt-get install open-cobol

Once the installation is completed you can check the cobol compiler details using the following comamnds

whereis cobc

output

cobc: /usr/bin/cobc /usr/share/man/man1/cobc.1.gz

which cobc

output

/usr/bin/cobc

Compile the cobol program

Compile the HelloWorld which will create the HelloWorld executable.

cobc -free -x -o helloworld-exe helloworld

ls

helloworld helloworld-exe*

-free – use free source format. Without this option cobol program requires certain format.
-x – build executable program.
-o FILE – place the output file into the specified FILE.

Execute the cobol Program

Execute by mentioning the program name.

./helloworld-exe

Hello World!

Via TheGeekstuff

Sponsored Link

Incoming search terms:

Related posts

Leave a Reply