Hello World/Code

These are Hello World examples in several common languages

Example in C

 * 1) include 

int main {   printf("This is my first C program!\n"); return 0; }

Example in C++
// Hello World in C++ (pre-ISO)


 * 1) include 

int main {   cout << "Hello World!" << endl; return 0; }

Example in Java
// Hello World in Java

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

Example in Perl

 * 1) Hello world in perl

print "Hello World!\n";

Example in PHP


Example in Python
print "Hello world"
 * 1) Hello World in Python

Example in VBScript
'Hello World in VBScript WScript.Echo "Hello world"

Example in Ruby
puts 'Hello world'
 * 1) Hello World in Ruby

Example in C#
// Hello World in C# class Hello {  static void Main {     System.Console.WriteLine("Hello World"); } }

Example in Quick Basic
// Hello World in QBasic CLS phrase$ = "Hello World!" PRINT phrase$ END

Example in Actionscript
// Hello World in Actionscript trace("Hello World!")

Example in Javascript
// Hello World in Javascript document.write("Hello World!")

Example in BASH shell scripting
mytext="Hello World!" echo "$mytext"
 * 1) !/usr/bin/bash #This is the location of your BASH shell