It so happened that the first program that every programmer writes when starting to learn a new programming language is a program that displays the text “Hello World” on the screen. In this article, we have collected an example of such a program in different programming languages.

Hello World in C

#include <stdio.h> int main(){
  printf("Hello, World!\n");
  return 0;}

Hello World in Java

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

Hello World in C++

#include <iostream>using namespace std; int main() {
    cout << "Hello, World!";
    return 0;}

Hello World in C#

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

Hello World in Python

print("Hello, World!")

Hello World in PHP

<?php  echo "Hello, World!";?>

Hello World in R

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

Hello World in JavaScript

<!DOCTYPE HTML>
<html>
 <body>
   <script>
    alert( 'Hello, world!' );
  </script>
 </body>
 </html>

Hello World in Pascal

program Hello;begin  writeln ('Hello, world!')end.

Hello World in Assembler

.MODEL SMALL.STACK 100h.DATA
    HelloMessage DB 'Hello World',13,10,'$'.CODESTART:
    mov ax,@data    mov ds,ax    mov ah,9
    mov dx,OFFSET HelloMessage
    int 21h    mov ah,4ch    int 21hEND START

Hello World in Scala

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

Hello World in Delphi

program Helloworld;{$APPTYPE CONSOLE}uses sysutils; 
begin
   writeln('Hello, World!');  
sleep(3000);end. //end

Hello World in Kotlin

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

Hello World in Ruby

puts "Hello, World!"

Hello World in Swift

import Swiftprint("Hello, World!")

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 Basic

PRINT "HELLO WORLD"

Hello World in Visual Basic .NET

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

Hello World in Rust

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

Leave a Reply

C#

04/02/2021