Tuesday, February 12, 2013

Hello World !!


Do you remember the first ever programming example that you had tried out, or you have been taught? That's it.... Hope you got it by now, But if not... you should be from a non 1s and 0s background.  "Hello World!" is the first sample program that is usually explained in any computer language.

Since this is the first time that I am writing a blog, I thought of telling you how to write the "Hello World" program in different languages according to the order I've learned.

C :
#include <stdio.h>                                                                            
//This is needed to be included to use the 'printf()'
int main(void)
{
    printf("Hello World!\n");
    return 0; // Notice the main method has a return type and its int

}

C++

#include <iostream.h>

int main()
{
    cout<<"Hello World"<<endl;                                                              //This prints "Hello World" and <<endl makes a new line
    return 0; 
}

VB
' Allow easy reference to the System namespace classes.
Imports System

' This module houses the application's entry point.
Public Module Modmain
   ' Main is the application's entry point.
   Sub Main()
     Console.WriteLine ("Hello World")                                                       ' Write text to the console.
   End Sub
End Module

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

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

All the "Hello Worlds" seem similar to me. How about you? But when you become familiar with one language for a long time you will tend to believe that the languages are completely different, yes of course they do from the technological point of view, but not from the foundation concepts.  

Most of my teenage life was spent with programming, fulfilling my learning thirst every day. 

So this is going to be a beginning of a long journey. I hope my visionary statements could guide me there.


1) Always seek a change, and if the change does not come to you, be the change you want to see around you.

2). Never satisfied with your current status, always improve it by revisiting what you have missed  

No comments:

Post a Comment