Home Articles Hello World in Different Programming Languages

Hello World in Different Programming Languages

Program examples in the most popular programming languages

by admin
Hello World in different languages

Traditionally, the first program that every programmer writes when starting to learn a new programming language is a program that prints the text “Hello World” to the screen. In this article, we have collected examples of this program in different programming languages.

Hello World in C

#include <stdio.h>

int main()
  printf("Hello, World!\n");
  return 0;

Hello World in Swift

import Swift
print("Hello, World!")

Hello World in Java

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

Hello World in Kotlin

package demo

fun main(args : Array<String>) {
  println("Hello, world!")

Hello World in Python

print("Hello, World!")

Hello World in PHP

  echo "Hello, World!";

Hello World in JavaScript


    alert( 'Hello, world!' );


Hello World in C++

#include <iostream>
using namespace std;

int main() 
    cout << "Hello, World!";
    return 0;

Hello World in Objective-C

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[])
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        NSLog (@"Hello, World!");
        [pool drain];
        return 0;

Hello World in C#

using System;

namespace HelloWorld
    class Hello 
        static void Main() 
            Console.WriteLine("Hello World!");

Hello World in Pascal

program Hello;
  writeln ('Hello, world!')

Hello World in Perl

print "Hello, World!\n";

Hello World in Scala

object HelloWorld {
  def main(args: Array[String]): Unit = {
    println("Hello, World!")

Hello World in Delphi

program Helloworld;
uses sysutils;

  writeln('Hello, World!');

Hello World in Ruby

puts "Hello, World!"

Hello World in R

> myString <- "Hello, World!"
> print ( myString)

Hello World in F#

printfn "Hello, World!"

Hello World in Basic


Hello World in Visual Basic .NET

Module Module1
    Sub Main()
        Console.WriteLine("Hello, World!")
    End Sub
End Module

Hello World in Prolog

main() :- write("Hello, World!"), nl.

Hello World in Rust

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

Hello World in Ada

with Ada.Text_IO;

procedure HelloWorld is
  Ada.Text_IO.Put_Line("Hello, World!");
end HelloWorld;

Hello World in Haskell

main = putStrLn "Hello, World!"

Hello World in Go

package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")

Hello World in Lisp

(format t "Hello, World!~%")

Hello World in MATLAB

disp('Hello, World!')

Hello World in Julia

println("Hello, World!")

Hello World in ABAP

REPORT first_programm.
WRITE / 'Hello, World!'.

Hello World in Erlang

main() -> io:format("Hello, World!~n").

Hello World in Fortran

program Hello
  print *, "Hello, World!"
end program Hello

Hello World in Assembler

.STACK 100h
    HelloMessage DB 'Hello World',13,10,'$'
    mov ax,@data
    mov ds,ax
    mov ah,9
    mov dx,OFFSET HelloMessage
    int 21h
    mov ah,4ch
    int 21h

Hello World in Arduino

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  lcd.begin(16, 2);
  lcd.print("Hello, World!");

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);

Hello World in AutoIt

#include <MsgBoxConstants.au3>

MsgBox($MB_OK, "Tutorial", "Hello World!")

Hello World in Smalltalk

Transcript show: 'Hello, world!'.

Hello World in 1С

Сообщить("Hello, World!");

Hello World in AppleScript

display dialog "Hello, World!"

Hello World in Actionscript

mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = false;

myformat = new TextFormat();
myformat.color = 0xff0000;
myformat.bullet = false;
myformat.underline = true;

mytext.text = "Hello, World!";

Hello World in CoffeeScript

alert "Hello, World!"

Hello World in Lua

print("Hello, World!")

Hello World in PowerShell

$strString = "Hello, World!"
write-host $strString

Hello World in D

import std.stdio;

void main() {
    writeln("Hello, World!");
5/5 - (3 votes)

Related Posts

Leave a Comment