Adam. R

How to write "Hello World" in every programming language!

Created March 5, 2022

Introduction

Let's get straight to the point. There are a lot of coding languages. Hello World is iconic so lets begin already!


C

#include <stdio.h>

int main() {
    printf("Hello World!");
}

C++

#include <iostream>
int main () {
    std::cout << "Hello World!";
}

Java

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

Python

print("Hello World!")

JavaScript

console.log("Hello World!");

C Sharp

namespace HelloWorld {
    class Hello {
        static void Main(string[] args) {
            System.Console.WriteLine("Hello World!")
        }
    }
}

Go

package main
import "fmt"

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

R

print("Hello World!")

Swift

print("Hello World!")

Rust

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

Kotlin

fun main(args: Array<String>) {
    println("Hello World!")
}

MATLAB

disp('Hello World!')

Perl

#!/usr/bin/perl

print "Hello World!";

PHP

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

Ruby

puts "Hello World!"

# Dart
```dart
main() {
    print("Hello World!")
}

Lua

print("Hello World")

BrainF**k

++++++++++[>+++++++>++++++++++>+++<<<-]>++.+++++++..+++.>++.<<+++++++++++++++.>,+++.------.--------.>+.

Conclusion

Wow! That was a lot. I know I missed out some but there are too much for me to handle! Mainly the BrainFuck one. Thats like writing binary but instead of 1's and 0's its special characters that make so sense. Well the name of BrainFuck has a reason its called that...

Buy Me A Coffee how2ubuntu