[ create a new paste ] login | about

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

C:
pasted 4 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 5 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)


C++:
pasted 4 hours ago:
1
2
3
4
5
6
#include <iostream>
uint8_t buttons;
int main()
{
    std::cout << "Hello, world!\n";
}
view (6 lines, 1 line of output)
pasted 4 hours ago:
1
2
3
4
5
6
#include <iostream>

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


Haskell:
pasted on Mar 3:
1
main = putStrLn "Hello, World!"
view (1 line, 1 line of output)
pasted on Mar 3:
1
main = putStrLn "Hello, World!"
view (1 line, 1 line of output)


Lua:
pasted on Mar 3:
1
print ("Hello World!")
view (1 line, 1 line of output)
pasted on Mar 2:
1
print "hello world";
view (1 line, 1 line of output)


OCaml:
pasted on Jan 20:
1
print_string "hello world"
view (1 line, 1 line of output)


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


Perl:
pasted on Mar 3:
1
print 'Hello, world!';
view (1 line, 1 line of output)
pasted on Jan 22:
1
print "Hello World\n";
view (2 lines, 1 line of output)


Python:
pasted yesterday:
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 Feb 26:
1
"hello world".each{|str| puts str}
view (1 line, 1 line of output)
pasted on Feb 26:
1
"hello world".each{|str| puts str}
view (1 line, 1 line of output)


Scheme:
pasted on Feb 17:
1
(display "Hello World")
view (1 line, 1 line of output)
pasted on Jan 25:
1
(display "Hello world")
view (1 line, 1 line of output)