[ 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 | Tcl ]

C:
pasted 30 seconds ago:
1
2
3
4
5
6
7
#include<stdio.h>
int main()
{

printf("Hello World!\n");
return 0;
}
view (7 lines, 1 line of output)
pasted 31 minutes ago:
1
2
3
4
5
6
7
8
#include<stdio.h>

int main()
{
    printf("Hello, World!\n");

    return 0;
}
view (8 lines, 1 line of output)


C++:
pasted 1 hour ago:
1
2
3
4
5
6
#include <iostream>

int main()
{
    cout << "Hello, World!\n";
}
view (6 lines, 1 line of output)
pasted 1 hour ago:
1
2
3
4
5
6
#include <iostream>

int main()
{
    std::cout << "Hello, World!\n";
}
view (6 lines, 1 line of output)


D:
pasted on Nov 22:
1
2
3
4
5
6
import std.stdio;

void main(string[] args)
{
    writefln("Hello world!");
}
view (6 lines, 1 line of output)
pasted on Nov 21:
1
2
3
4
5
6
import std.stdio;

void main(string[] args)
{
    writefln("Hello world!");
}
view (6 lines, 1 line of output)


Haskell:
pasted on Nov 24:
1
2
3
main = putStrLn "Hello World"

fibs = 0:1:[x+y|(x,y) <- zip fibs (tail fibs)]
view (3 lines, 1 line of output)
pasted on Nov 24:
1
main = putStrLn "Hello World"
view (1 line, 1 line of output)


Lua:
pasted yesterday:
1
print("Hello World!")
view (1 line, 1 line of output)
pasted on Nov 21:
1
2
3
4
5
print"Hello World!"

Lol = [[Multiple lines of text
>> can be enclosed in double square
>> brackets.]]
view (5 lines, 1 line of output)


OCaml:
pasted on Nov 13:
1
print_string "Hello, world!\n";;
view (1 line, 1 line of output)
pasted on Nov 13:
1
print_string "Hello World!"
view (1 line, 1 line of output)


PHP:
pasted 22 minutes ago:
1
2
3
<?php
echo "hello world"
?>
view (3 lines, 1 line of output)
pasted 1 hour ago:
1
<? echo 'hello world';
view (1 line, 1 line of output)


Perl:
pasted 3 hours ago:
1
print "hello world"
view (1 line, 1 line of output)
pasted yesterday:
1
print "Hello world!";
view (1 line, 1 line of output)


Python:
pasted 33 minutes ago:
1
2
s="Hello world"
print str(s)
view (2 lines, 1 line of output)
pasted yesterday:
1
print "Hello world"
view (1 line, 1 line of output)


Ruby:
pasted on Nov 24:
1
puts "hello world!"
view (1 line, 1 line of output)
pasted on Nov 22:
1
puts "Hello, World!"
view (1 line, 1 line of output)


Scheme:
pasted on Nov 21:
1
(display "Hello, World!")
view (1 line, 1 line of output)
pasted on Nov 17:
1
2
(+ 2 3 3)
(display "hello world")
view (2 lines, 1 line of output)


Tcl:
er_vikram190@hotmail.com - pasted on Nov 9:
1
puts -nonewline "Hello world"
view (1 line, 1 line of output)
pasted on Nov 4:
1
puts -nonewline "Hello world"
view (1 line, 1 line of output)