It is traditional to say hello as a first example program.

Hello in K&R C:

main()
{
    puts("Hello, world!");
}

Hello in ANSI C:

#include <stdio.h>
void main(void)
{
    printf("Hello, world!");
}

Hello in ANSI C++:

#include <cstdio>
using namespace std
void main(void)
{
    printf("Hello, world!");
}

Hello in C#:

using System;
class Hello
{
    public static void Main()
    {
        Console.WriteLine("Hello, world!");
    }
}

Hello in Java:

class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

Hello in JavaScript:

<script language="JavaScript">
    //Client-side
    document.write("Hello, world!");
</script>
<%@ language="JavaScript" %>
<%
    //Server-side via ASP
    document.write('<p>Hello, world!</p>');
%>

Hello in PERL:

# Hello world in perl
print "Hello World!\n";

Hello in PHP:

<?php
    echo '<p>Hello World</p>';
?>


GeorgeHernandez.comSome rights reserved