"Hello world!" in 10 different programming languages

in #teamserbia8 years ago (edited)

A "Hello, world!" program is usually used to introduce programmers with a new programming language. It is a computer program whose output on the display shows the sentence "Hello, world!". It is believed that the first example of such a program was written by Brian Kernighan in the well-known book The C Programming Language he wrote with Dennis Ritchie.


I'm a student of computer science and I want to tell you if you want to start programming you must first choose a programming language to learn very well. Because, if you understand one programming language, you will understand much easier the next one you choose to learn. My first programming language is C. Knowledge from C was the basis for an easier understanding of all the other programming languages I have learned.

In this post I will write a well known "Hello, world!" program in 10 different programming languages. You will notice that this program is very similar in some programming languages, and in some very different. It depends on the syntax of the programming language and embedded libraries and functions, but the essence is the same.

"Hello, world!" in C

int main()
{
   printf("Hello, world!");
   return 0;
}

"Hello, world!" in C++

int main() 
{
    cout << "Hello, world!";
    return 0;
}

"Hello, world!" in C#

using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
            Console.ReadLine();
        }
    }
}

"Hello, world!" in Java

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

"Hello, world!" in PHP

Print "Hello, world!"; 

"Hello, world!" in MATLAB

disp('Hello, world')

"Hello, world!" in Javascript

alert( 'Hello, world!' );

"Hello, world!" in PL/SQL

BEGIN
dbms_output.put_line (‘Hello World..');
END

"Hello, world!" in Perl

 #!/usr/bin/perl
  use strict;
  use warnings;
  print "Hello, World!\n";

"Hello, world!" in Pascal

begin
  WriteLn;
  WriteLn( 'Hello World!');
  WriteLn;
end

If you want to learn more about "Hello, world!" program, visit this site https://en.wikipedia.org/wiki/%22Hello,_World!%22_program
Sort:  

I just resteemed your post to my 31,000+ followers @a-0-0 :)

I just resteemed your post to my 31,000+ followers @a-0-0 :)

Coin Marketplace

STEEM 0.05
TRX 0.33
JST 0.080
BTC 63745.71
ETH 1690.28
USDT 1.00
SBD 0.41