“Hello World!” in 50 Popular Programming Languages To Help You Decide Which one I for You

The “Hello, World!” program is the most basic program written to display or show “Hello, World!” on a screen or any other display media. If you have done any programming, or just starting it’s most likely you have encountered “Hello, World!”. It’s mostly used to introduce people who are just starting to program.

Almost if not all programming languages start with a “hello world!” program whether it’s Java, Python, Go, Scala, Cobo, etc There are tonnes of programming languages out there, and what makes them the same is that they all will give you a “hello world” to start your programming journey

Here in this post, I did some research just for you on how to write “Hello World!” in 50 popular programming languages, now dig in.

Python

#python 2
print “Hello, World!”
#python3
print(“Hello, World!”)

Java

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

Go /Golang from Google

package main

    import "fmt"
    func main() {
        fmt.Println("Hello, world!")
    }

Javascript

console.log(“Hello, World!”);

alert(“Hello, World!”);

document.write('Hello, World!');

C

//originally
main()
    {
         printf("hello, world\n");
    }

//current
#include <stdio.h>
    int main(void)
    {
         printf("hello, world\n");
    }

Autolt

MsgBox(0,'','Hello, world!')

C#

using System;
    class Program
    {
            public static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
            }
    }

C++ / Cpp

#include <iostream>
    int main()
    {
     std::cout << "Hello, world!\n";
    }

PHP

<?='Hello world';
 
<?= "Hello, world!" ?>

<? echo "Hello, world!"?>

<!DOCTYPE html>
<html>
   <head>
      <title>PHP "Hello, World!" program</title>
   </head>
   <body>
      <?php echo '<p>Hello World</p>'; ?>
   </body>
</html>

Ada

with Ada.Text_IO; use Ada.Text_IO;
    procedure Hello is
    begin
        Put_Line ("Hello, world!");
    end Hello;

Visual Basic

Private Sub Form_Load()

MsgBox"Hello, World!"

    End Sub

Shell

echo “Hello, World!”

Scala

object HelloWorld extends App {
println("Hello, World!")
}

//or

println("Hello, World!")

Rust

fn main() {
println!("Hello World");
}

Dart

void main(){
print (“Hello World”);
}

main(){
print(“Hello, World!”);
}
main()=>print(“Hello World!”);

Kotlin

fun main() {
println("Hello, World!")
}

R

print('Hello, world!')

Elixir

iex> IO.puts("Hello World!")

Perl/ Perl 6

print "Hello, World!\n";

Scheme

(display "Hello, world!\n")

Transcript

show: 'Hello, world!'.

Julia

 println("Hello, world!")

ASP

<% Response.Write("Hello, world!") %>
<%= "Hello, world!" %>

AutoHotkey

MsgBox, Hello, world!

Basic

    PRINT "Hello, world!"
    END
PRINT "Hello, world!"
    ? "Hello, world!"

Lisp

(print “Hello, world!”)

Fortran

program hello world
print *,”Hello, world”
endprogram hello world

Cobol

IDENTIFICATION DIVISION.
PROGRAM-ID. hello-world.
PROCEDURE DIVISION.
DISPLAY "Hello, world!" .

Clojure

(defn -main
[& args]
(println "Hello, World!"))

Node.js

console.log(“Hello, World!”);
Objective C
// FILE: hello.m
    #import <Foundation/Foundation.h>
    int main (int argc, const char * argv[])
    {
      NSLog(@"Hello, World! \n");
      return 0;
    }

Lua

print(“Hello, World!”)
print ‘Hello, World’

Haskell

module Main (main) where        
    main :: IO ()                    
    main = putStrLn "Hello, World!"

Ruby

puts ‘Hello, world’

Clean

module hello
 
    Start = "Hello, world!"

Pascal

begin
        write('Hello, world!');
    end.

Nim

echo ‘Hello, World!’
echo(“Hello, world!”)

Vala

using GLib;
        public int main(string[] args)
    {
       stdout.printf("Hello, world!\n");
       return 0;
}

Processing

println("Hello, world!");

ABC

WRITE "Hello, world!"

F#

let _ = System.Windows.Forms.MessageBox.Show("Hello, world!");;

B

        extrn a, b, c;
        putchar(a); putchar(b); putchar(c); putchar('!*n');
    }
    a 'hell';
    b 'o, w';
    c 'orld';

PostScript

(Hello, world!\n) print

Prolog

:- write('Hello, world!'),nl.

Windows PowerShell

echo "Hello, world!"
Write-Host "Hello, world!"
"Hello, world!"

P programming language

"Hello, world!\n"

ALGOL 68

begin
            printf($"Hello, world!"l$)
    end

Pure Basic

OpenConsole()
    PrintN("Hello, world!")
    Input()
    MessageRequester("Hello, World","Hello, World")


    debug”Hello, world!"

Delphi

{$APPTYPE CONSOLE}
    begin
        Writeln('Hello, world!');
    end.

D++

function main()
    {
            screenput "Hello, world!";
    }

Chrome

namespace HelloWorld;
interface
type
  HelloClass = class
  public
    class method Main; 
  end;
implementation
class method HelloClass.Main;
begin
  System.Console.WriteLine('Hello, world!');
end;
 
end.

Swift

println("Hello, world!")
print("Hello, world!")

Stata

capture program drop hello /*Define Hello, world! program*/
 program define hello   
      di "Hello, world!"
 end
 hello

Groovy

println "Hello, world!"

Batch

@echo Hello World!

SVG

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <svg xmlns="http://www.w3.org/2000/svg" width="200" height="100">
        <text x="50" y="50">Hello, world!</text>
    </svg>

Obix

system.console.write_line ( "Hello, world!" )

Clipper

? "Hello, world!"
@1,1 say "Hello, world!"
Qout("Hello, world")

Hey, if you read to place well, you may be you’re interested in doing some programming, I hope the above examples may have shown you which one you’d want to start with.

Good luck, have a good one be blessed

I love coding and writing
Posts created 25

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top