Linux-palvelimet ICT4TN021-7 linux server course assignment 6

This assignment is part of linux server course ICT4TN021-7, undertaken at Haaga-Helia UAS.

 

A) Write and execute “Hei maailma” (Hello world) in three languages. Install necessary environments.

First, i decided to try C. I found a C “Hello world” example here.

I ran following commands:

Screenshot_2018-03-04_21-51-25

I installed gcc to compile C, created a folder for my various “Hei maailma”-programs, changed location to the newly created folder and launched nano to write my first program.

In nano i wrote the program:

Screenshot_2018-03-04_21-54-13

Then i compiled and ran the program:

Screenshot_2018-03-04_21-53-37

The program printed following text:

Screenshot_2018-03-04_21-55-50

Next, i tried same with python, i found a tutorial here:

There was no need for me to install python since the needed package “python3” was already installed on xubuntu.

Screenshot_2018-03-04_22-10-05.png

Screenshot_2018-03-04_22-10-32

Then i just ran the program:

Screenshot_2018-03-04_22-08-59

Wow, it was really effortless and simple compared to C!

Finally i tried perl, which also was installed by default on xubuntu. I found a “Hello world” tutorial here:

Screenshot_2018-03-04_22-28-40.png

Screenshot_2018-03-04_22-28-13.png

I ran the program:

Screenshot_2018-03-04_22-28-56

“Hello world” on perl was also fairly effortless to write and execute, but contain more code compared to python3’s one line.

 

Sources: http://terokarvinen.com/2017/aikataulu-%e2%80%93-linux-palvelimet-ict4tn021-7-ti-ja-6-to-alkukevat-2018-5-op,

https://www.programiz.com/c-programming/examples/print-sentence,

https://www.digitalocean.com/community/tutorials/how-to-write-your-first-python-3-program,

http://search.cpan.org/dist/Perl-Tutorial/lib/Perl/Tutorial/HelloWorld.pod

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s