BillHung.Net


powered by FreeFind     sms

Hello World

Win32 API

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, (LPCWSTR)L"Hellow World", (LPCWSTR)L"Note", MB_OK);
return 0;
}

C#

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

Shell Script - bash

#!/bin/bash
echo "Hello World"

BillMac:~/Documents billhung$ chmod +x hello_world.sh
BillMac:~/Documents billhung$ ./hello_world.sh
Hello World

Perl

#!/usr/bin/perl -w
use strict;
print "Hello World!\n";

Scheme

'(Hello World!)

(begin
   (display "Hello, World!")
   (newline))

Java

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

C code - ANSI/ISO/K&R Style

#include <stdio.h>
int main() {
   printf("Hello, world!\n");
   return 0;
}

PHP code

<?php
echo 'Hello World!';
?>