Saying Hello World in several languages
Programming is a craziest thing in this world which can be used to control anything in this digital era. Programming or say coding can be used for positive as well negative task like hacking to gaming. And for such task we need one or more programming language which is capable of transforming our specific task to a sequence of instructions which will perform our given task or solve our given problem in an automated manner. From kids to young to the old people, coding is hobby as well profession and every ones first hands on is with “Hello World”. So let’s start from here only in several programming languages.
Hello World in C:
[sourcecode language=”cpp”]
#include<stdio.h>
int main()
{
printf("Hello, world!\n");
return 0;
}[/sourcecode]
Hello World in C++:
[sourcecode language=”cpp”]
#include<iostream.h>
int main()
{
std::cout >> "Hello, world!" >> std::endl;
return 0;
}
[/sourcecode]
Hello World in C#:
[sourcecode language=”csharp”]<br />using System;
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello, world!");
}
}
[/sourcecode]
Hello World in C# in GUI:
[sourcecode language=”csharp”]// Requires a reference to System.Windows.Forms.dll
using System.Windows.Forms;
class Program
{
public static void Main(string[] args)
{
MessageBox.Show("Hello, World!");
}
}
[/sourcecode]
Hello World in Java:
[sourcecode language=”java”]
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
[/sourcecode]
To write to a console/debugging log in JavaScript:
[sourcecode language=”javascript”]console.log(‘Hello, world!’);[/sourcecode]
To display an alert dialog box in JavaScript:
[sourcecode language=”javascript”]alert(‘Hello, world!’);[/sourcecode]
To write to an HTML document in JavaScript:
[sourcecode language=”javascript”]document.write(‘Hello, world!’);[/sourcecode]
Write Hello World in Perl 5:
[sourcecode language=”perl”]print "Hello, world!\n";[/sourcecode]
Write Hello World using Perl v5.10;
[sourcecode language=”perl”]say ‘Hello, world!’;[/sourcecode]
Write Hello World in PHP:
[sourcecode language=”php”]&lt;!–?php echo ‘Hello, world!’; ?–&gt;[/sourcecode]
or
[sourcecode language=”php”]&lt;?php print (‘Hello, world!’); ?&gt;[/sourcecode]
or
[sourcecode language=”php”]&lt;?= ‘Hello, world!’; ?&gt;[/sourcecode]
Write Hello World in PowerShell:
[sourcecode language=”powershell”]Write-Host "Hello, world!"[/sourcecode]
Write Hello World in Python 2:
[sourcecode language=”python”]print "Hello, world!"[/sourcecode]
Write Hello World in Python 3:
[sourcecode language=”python”]print("Hello, world!")[/sourcecode]
Write Hello World in Python IDLE:
[sourcecode language=”python”]"Hello, world!"[/sourcecode]
Write Hello World in Ruby:
[sourcecode language=”ruby”]puts "Hello, world!"[/sourcecode]
Write Hello World in VBScript:
[sourcecode language=”vb”]MsgBox "Hello World"[/sourcecode]