[ create a new paste ] login | about

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

C:
pasted yesterday:
1
2
3
4
#include <stdio.h>
void main() {
  printf("Hello World");
}
view (4 lines, 1 line of output)
pasted yesterday:
1
2
3
4
5
6
7
#include  <stdio.h>

int main(void)
{
    printf("Hello, world!\n");
    return 0;
}
view (7 lines, 1 line of output)


C++:
pasted on Mar 22:
1
2
3
4
5
6
7
#include <stdio.h>

int main (void)

{
    printf("hello world!\n");
}
view (7 lines, 1 line of output)
pasted on Mar 21:
1
2
3
4
5
#include<stdio.h>
int main() {
	printf("Hello, World!\n");
	return 0;
}
view (5 lines, 1 line of output)


Haskell:
pasted on Feb 20:
1
2
3
4
module Main
where
main=
    putStrLn "Hello World!"
view (4 lines, 1 line of output)
pasted on Feb 20:
1
2
3
4
module Main
where
main = 
    putStrLn "Hello World!"
view (4 lines, 1 line of output)


Lua:
pasted on Mar 20:
1
print("Hello, world!")
view (1 line, 1 line of output)
pasted on Mar 5:
1
print("hello world")
view (1 line, 1 line of output)


PHP:
pasted on Mar 13:
1
2
3
<?php
echo "Hello, world!";
?>
view (3 lines, 1 line of output)
pasted on Mar 9:
1
2
3
<?php
echo "hello world!";
?>
view (3 lines, 1 line of output)


Perl:
pasted on Mar 16:
1
2
$variable = "Hello World";
print ("$variable");
view (2 lines, 1 line of output)
pasted on Mar 16:
1
2
$variable = "Hello World";
print ($variable);
view (2 lines, 1 line of output)


Python:
pasted 1 hour 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)


Ruby:
pasted on Mar 7:
1
print "hello world"
view (1 line, 1 line of output)
pasted on Mar 5:
1
2
3
comment = "Hello, World";

print comment;
view (3 lines, 1 line of output)


Scheme:
pasted on Mar 16:
1
2
(define x "hello world")
(display x)
view (3 lines, 1 line of output)
pasted on Mar 16:
1
2
(define x "hello world")
(display x)
view (3 lines, 1 line of output)