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

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


C++:
pasted on May 19:
1
2
3
4
5
6
7
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello, world!" << endl;
    return 0;
}
view (7 lines, 1 line of output)
pasted on May 19:
1
2
3
4
5
6
7
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello, world!" << endl;
    return 0;
}
view (7 lines, 1 line of output)


Haskell:
pasted on Mar 4:
1
2
3
import Control.Applicative

main = putStrLn "Hello, world!"
view (3 lines, 1 line of output, 24 comments)
pasted on Dec 30:
1
2
3
import Control.Applicative

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


Lua:
pasted yesterday:
1
print ("Hello World")
view (1 line, 1 line of output)
pasted on Apr 27:
1
print('hello world')
view (1 line, 1 line of output, 23 comments)


PHP:
pasted on May 12:
1
2
3
<?php

echo "Hello World";
view (3 lines, 1 line of output, 26 comments)
pasted on Apr 17:
1
2
3
4
5
<?php
$metin = "<h1>Hello WorldÆØÅ!</h1>";
$yeni_metin=filter_var($metin,FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_HIGH);
echo $yeni_metin;
?>
view (5 lines, 1 line of output, 23 comments)


Perl:
pasted on Apr 20:
1
2
3
use strict;
use warnings;
print "Hello World\n";
view (3 lines, 1 line of output, 26 comments)
pasted on Apr 20:
1
print "Hello World\n";
view (1 line, 1 line of output, 27 comments)


Python:
pasted on May 19:
1
print("Hello world")
view (1 line, 1 line of output)
pasted on May 19:
1
print("Hello World")
view (1 line, 1 line of output)


Ruby:
pasted on May 3:
1
print('hello world')
view (1 line, 1 line of output, 23 comments)
pasted on Mar 13:
1
2
text = "Hello World"
puts text
view (2 lines, 1 line of output, 27 comments)