[ create a new paste ] login | about

Listed below are example programs that print "hello world", written in the following languages:
[ C | C++ | D | Haskell | Lua | OCaml | PHP | Perl | Python | Ruby | Scheme ]

C:
pasted 35 minutes ago:
1
2
3
4
5
6
7
8
9
10
#include <stdio.h> 
int main()

{

  puts("hello, world!");

  return 0;

} 
view (10 lines, 1 line of output)
pasted 46 minutes ago:
1
2
3
4
5
6
7
8
9
10
#include <stdio.h> 
int main()

{

  puts("hello, world!");

  return 0;

} 
view (10 lines, 1 line of output)


C++:
pasted 2 hours ago:
1
2
3
4
5
6
#include <stdio.h>
int main()
{
    printf("Hello World!");
    return 0;
}
view (6 lines, 1 line of output)
pasted 2 hours ago:
1
2
3
4
5
6
#include <stdio.h>
int main()
{
    printf("Hello World!");
    return 0;
}
view (6 lines, 1 line of output)


D:
pasted on Dec 8:
1
2
3
4
5
6
import std.stdio;

void main()
{
    writefln("Hello, World!");
}
view (6 lines, 1 line of output)
pasted on Aug 30:
1
2
3
4
5
6
import std.stdio;

void main()
{
    writefln("Hello, World!");
}
view (6 lines, 1 line of output)


Haskell:
pasted on Jan 16:
1
main = putStrLn "Hello, World!"
view (1 line, 1 line of output)
pasted on Dec 25:
1
2
3
module Main () where

main = putStrLn "Hello World!"
view (3 lines, 1 line of output)


Lua:
ethanli - pasted on Jan 16:
1
print("hello world")
view (1 line, 1 line of output, 1 comment)
pasted on Jan 9:
1
print("Hello World") 
view (1 line, 1 line of output)


OCaml:
pasted on Nov 3:
1
let () = print_endline "Hello, World!"
view (1 line, 1 line of output)
pasted on Jul 26:
1
print_endline("hello world")
view (1 line, 1 line of output)


PHP:
pasted 4 hours ago:
1
2
3
4
5
<?php

echo 'Hello World';

 ?>
view (5 lines, 1 line of output)
pasted yesterday:
1
2
3
4
5
6
<?php
echo "hello world";



?>
view (6 lines, 1 line of output)


Perl:
sprakbankental - pasted on Jan 12:
1
print "hello world\n";
view (1 line, 1 line of output)
pasted on Jan 12:
1
print "hello world\n";
view (1 line, 1 line of output)


Python:
pasted 4 hours ago:
1
print ('Hello world!')
view (1 line, 1 line of output)
pasted 5 hours ago:
1
2
3
import sys
sys.version
print("Hello World")
view (3 lines, 1 line of output)


Ruby:
pasted on Jan 7:
1
print "hello world"
view (1 line, 1 line of output)
pasted on Jan 5:
1
puts "Hello world!"
view (1 line, 1 line of output)


Scheme:
pasted on Nov 16:
1
2
3
4
(begin

  (display "Hello, World!")
)
view (4 lines, 1 line of output)
pasted on Nov 16:
1
2
3
4
5
(begin

  (display "Hello, World!")

  (newline))
view (6 lines, 1 line of output)