[challenge] The Hello World Challenge

This challenge is to print to console “Hello World” in several different ways in any programming language. If someone has already posted a way to say “Hello World”, you cannot use it again.

For example,
JavaScript: console.log("Hello World");

Good luck! Let’s see how many different types of code we can create to say Hello World! :slightly_smiling:

EDIT: Thanks to @albionsrefuge for showing this cool site to give more ideas for languages and test them: https://repl.it/languages

2nd EDIT: Check out @g4be’s new awesome challenge here!

4 Likes
                                                ^

Javascript: console.log(“Hallo Wereld”)

In Afrikaanns

4 Likes

Forgot to fix, I meant to say programming language. Not a speaking language haha :stuck_out_tongue:

3 Likes

python3:

print("Hello world")

python2:

print "Hello world"

c:

printf("Hello world\n");

ruby:

puts "Hello world"
5 Likes

Ruby:

puts "Hello, World!"
5 Likes

Looks like someone beat you to ruby haha :slightly_smiling:

3 Likes

Uhm… i think i need to rewrite my C program:

#include <stdio.h>

int main(void){
  printf("hello, world\n");
}
7 Likes

Gotta give Java some love:
Java: System.out.println("Hello World!");

5 Likes

@grisful Woops, I didn’t see @stetim94’s post :slight_smile:

Am I remembering wrong, or does Ruby have print, like Python?
Ruby:

print "Hello, World!"
4 Likes
Unix scripts: echo "Hello World"
6 Likes

Yup! Python does have the same print “type” as Ruby (I think).

2 Likes

I think my reply was just a few seconds before you. Yes, ruby also has a print

How could i forgot unix script? :frowning: for someone who uses linux on a daily basis, that is quit a shame

3 Likes

Lua

print("Hello World")

D

import std.stdio;

void main()
{
  writeln("Hello, World!");
}
4 Likes

Nice! :slightly_smiling:

3 Likes

If I’m not wrong, this code in Assembly is correct.

.data msg: .asciiz "Hello World" .text .globl main main: li $v0, 4 la $a0, msg syscall jr $ra

Edit: Yep, is correct. Wrote this back in 2015/January :heart_eyes:

4 Likes

"Hello World" in Scheme, a dialect of Lisp …

(print "Hello World")
3 Likes

R:

hello <- function( name ) {
    sprintf( "Hello, %s", name );
}
2 Likes

Java:

public class HelloWorld{
	public static void main(String[] args) {
		System.out.printf("HelloWorld");
	}
}

PHP:

<?php
    echo "Hello World";
?>

Verilog:

module HelloWorld;

initial
    begin
        $display("Hello, world!");
        #5    
    end 
endmodule

Go

import "fmt"
func main() {
  fmt.Println("Hello World");
}
2 Likes

There is a language i don’t know, i do know it exist, it is called brainfuck, this is hello world in brainfuck:

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

Oh, and we are still missing c++/c#, but i don’t know those languages.

4 Likes

With the very little I know in Haskell hello world would be printed like this

putStrLn "Hello World"

1 Like