Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# - Simple Console Hello World
#1
Spartacus Wrote:alright what's next?! Hello World?! Tic Tac Toe?!
If there's anything I can't say no to, that would be the Holy seek for knowledge.

To start developing software you need a Code Developing Environment, & since were using Microsoft C.Sharp language we need to get:
(Microsoft Visual Studio 2010)
[Image: lk9ppgqvkxncsdz5w7cp.png]

Now to develop a sample application to demonstrate basics you need to start coding..

Note: Everything I write after "//" will not be compiled when you build your project.

Code:
using System; //references that will connect you to the OS.
using System.Collections.Generic;  //references that will connect you to the OS.
using System.Linq;  //references that will connect you to the OS.
using System.Text;  //references that will connect you to the OS.

namespace helloworld         //Executable name.
{
    class Program          //to initiate the program.
    {
        static void Main(string[] args)    //to build a main form to code in.
        {
                Console.WriteLine("Hello World");
        }
    }
}

Now this simple program is done, and it's only function is to print Hello World on the DOS screen.

Now to compile the code, & get a preview of what you've done:
Press (CTRL + F5).


Output:
[Image: iz3jlhaxcqo2gvjk7p1n.png]

This would be the simplest program to do, but it should give a very clear idea about the language & the developing environment.

You can ask about stuff you didn't understand.
[Image: bxj6gaq99c9hyvinfkvn.jpg]
[Image: w0l5y0.png]

Users browsing this thread: 1 Guest(s)