The Official Hello world thread!.....

What is your preferred language?

  • C - GNU C, Borland C,....

    Votes: 2 15.4%
  • C++, Visual C++, g++....

    Votes: 4 30.8%
  • Java

    Votes: 1 7.7%
  • C#.NET

    Votes: 2 15.4%
  • PHP

    Votes: 0 0.0%
  • VB.NET

    Votes: 2 15.4%
  • Python

    Votes: 2 15.4%
  • Perl

    Votes: 0 0.0%
  • Ruby

    Votes: 0 0.0%
  • Cobol

    Votes: 0 0.0%

  • Total voters
    13
Status
Not open for further replies.

Liverpool_fan

Sami Hyypiä, LFC legend
Python:

Code:
print "Hello World"

Or More structural:

Code:
def main():
	print "Hello World"
	
if __name__=='__main__':
	main()

Ruby:
Code:
puts "Hello World"
 
Last edited:

Disc_Junkie

Call me D_J!
JAVA

Code:
[FONT=&quot][B]
[/B][/FONT]class HelloWorld
{
           public static void main()
           {
           System.out.println("Hello World");
           }
}

C++



Code:
#include<iostream.h>
#include<conio.h>
void main()
        {
         cout<<"Hello World";
         getch();
        }
 
Last edited:

nvidia

-----ATi-----
C#:
Code:
namespace Hello_World
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Console.Write("Hello World");
        }
    }
}
 

Liverpool_fan

Sami Hyypiä, LFC legend
[



C++



Code:
#include<iostream.h>
#include<conio.h>
void main()
        {
         cout<<"Hello World";
         getch();
        }

Er..um..this is not exactly according to standards. This is actually Turbo C++ taught in schools and colleges in India.
Anyway it should be

Code:
#include<iostream>

int main()
{
       std::cout<<"Hello World";
       return 0;
}
Disk_Junkie said:
Code:
[FONT=&quot][B]
[/B][/FONT]class HelloWorld
{
           public static void main()
           {
           System.out.println("Hello World");
           }
}
Shouldn't there be String[] arguments in main()? (I know a crap about java but I think Java requires arguments for main as such)
 
Last edited:

Disc_Junkie

Call me D_J!
Er..um..this is not exactly according to standards. This is actually Turbo C++ taught in schools and colleges in India.
Anyway it should be

Code:
#include<iostream>

int main()
{
       std::cout<<"Hello World";
       return 0;
}
You used the int return type and I used void. Yup I coded it according to Turbo C++. But thanks for your example...:)

Shouldn't there be String[] arguments in main()? (I know a crap about java but I think Java requires arguments for main as such)

It isn't necessary as such(as the program will still compile) but yup it's worth mentioning...
 
OP
vamsi360

vamsi360

Always confused
in C#:

Code:
using System;
class HelloWorld  {
     static void Main()  {
           Console.WriteLine("Hello, World!");
     }
}

in PHP:

Code:
<?php
echo "Hello, World!";
?>
 

Liverpool_fan

Sami Hyypiä, LFC legend
Ruby
Code:
#!/usr/bin/env ruby
puts "Hello World"
D
Code:
import std.stdio;

int main(char[][] args)
{
    writefln("Hello World");
    return 0;
}
 
Last edited:
Status
Not open for further replies.
Top Bottom