‘Hello world’ in 20+1 different programming languages

Hello! Since it is my first blog post I decided to write a ‘hello world’ post with examples from different programming languages.

A hello world program is used to give the reader a quick overview of the programming language syntax and also get the code for the bare minimum program to run.

Le’ts not waste another minute and get to it.

  1. PHP
    <?php echo "hello world!";?>
  2. Javascript
    alert("hello world!");
  3. Python
    print("hello world")
  4. C
    int main(void)
    {
    puts("Hello, world!");
    }
    
  5. C++
    #include <iostream.h>
    
    main()
    {
        cout << "Hello World!" << endl;
        return 0;
    }
    
  6. C#
    using System;
    class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
        }
    }
    
  7. Objective C
    int main(void)
    {
    &nbsp; &nbsp; NSLog(@"Hello, world!");
    &nbsp; &nbsp; return 0;
    }
    
  8. HTML
    Hello World!
    
  9. Matlab
    disp('Hello, world!')
    
  10. Java
    
    class HelloWorld {
      static public void main( String args[] ) {
        System.out.println( "Hello World!" );
      }
    }
    
    
  11. MS DOS
    
    ECHO Hello World!
    
    
  12. Linux Bash
    echo "Hello World!";
    
  13. Node.js
    var sys = require('sys');
    sys.puts('Hello World');
    
  14. Ruby
    puts "Hello World!"
    
  15. BASIC
    10 PRINT "Hello World!"
    
  16. Visual Basic 6
    Private Sub Form_Load()
    Print "Hello World"
    End Sub
    
  17. Visual Basic .NET
    Imports System.Console
    
    Class HelloWorld
    
        Public Shared Sub Main()
            WriteLine("Hello, world!")
        End Sub
    
    End Class
    
  18. Pascal
    program HelloWorld(output);
    begin
      WriteLn('Hello World!');
    end.
    
  19. ASP.NET
    <%= "Hello World!" %>
    
  20. Fortran 77
    PROGRAM HELLO
    PRINT*, 'Hello World!'
    END
    
  21. Arduino
    void setup()
    {
      Serial.begin(9600);
      Serial.println("Hello, world!");
    }
    
    void loop()
    {
      
    }
    

 

When I started writing this post I was sure I would write each hello world on my own. But as the list was growing I got a bit tired and googled some of the programs. Doing that I stumpled upon a website with 533 ‘hello world’ programs http://helloworldcollection.de/