DEV Community

Cover image for Hello world in 16 languages
mohammad hassani
mohammad hassani

Posted on • Edited on

9 3

Hello world in 16 languages

Hi I want to show you "hello world" in 16 programming languages

1 C++

int main() {
    std::cout << "Hello world!\n";
}
Enter fullscreen mode Exit fullscreen mode

2 Java

public class Main {
    public static void main(String[] args) {
    system.out.println("Hello world!");
    }
}
Enter fullscreen mode Exit fullscreen mode

3 Python

print "Hello world!"
Enter fullscreen mode Exit fullscreen mode

4 Python3

print("Hello world!")
Enter fullscreen mode Exit fullscreen mode

5 C

#include<stdio.h>

int main(void) {
    puts("Hello World!");
    return 0;
}
Enter fullscreen mode Exit fullscreen mode

6 Csharp

class HelloWorld {
    static void Main() {
        System.Console.WriteLine("Hello World!");
    }
}
Enter fullscreen mode Exit fullscreen mode

7 Javascript

(function main() {
    console.log('Hello World!');
}());
Enter fullscreen mode Exit fullscreen mode

8 TypeScript

(function main() {
    console.log('Hello World!');
}());
Enter fullscreen mode Exit fullscreen mode

9 Ruby

#!/usr/bin/env ruby
puts "Hello World!"
Enter fullscreen mode Exit fullscreen mode

10 Swift

print("Hello world!")
Enter fullscreen mode Exit fullscreen mode

11 Go

func main() {
    fmt.Printf("Hello, World!")
}
Enter fullscreen mode Exit fullscreen mode

12 Bash

echo 'Hello, world'
Enter fullscreen mode Exit fullscreen mode

13 Scala

object Main extends App {
    println("Hello, World!")
}
Enter fullscreen mode Exit fullscreen mode

14 Kotlin

fun main(args: Array<String>) {
    println("Hello, World!")
}
Enter fullscreen mode Exit fullscreen mode

15 Rust

fn main() {
    println!("Hello, World!");
}
Enter fullscreen mode Exit fullscreen mode

16 PHP

echo "Hello world";
Enter fullscreen mode Exit fullscreen mode

Be happy! :)

buy me a coffee

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (3)

Collapse
 
epsi profile image
E.R. Nurwijayadi

Leverage your hello world to data structure in 18 languages. This article series is consist about 30 articles, and still counting.

🕷 epsi.bitbucket.io/lambda/2020/11/0...

Concurrency in Rust

Collapse
 
bmuskalla profile image
Benjamin Muskalla

You missed Brainfuck and Shakespeare ;)

Collapse
 
rinkton profile image
Rinkton

Is it a challenge? So, russian reposte: youtube.com/watch?v=IMLwb8DIksk . There is 20 Hello World.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more