You are viewing our Forum Archives. To view or take place in current topics click here.
Basic C# tutorial Hello World in Console
Posted:

Basic C# tutorial Hello World in ConsolePosted:

thejaggerizer
  • Junior Member
Status: Offline
Joined: Apr 04, 201014Year Member
Posts: 88
Reputation Power: 3
Status: Offline
Joined: Apr 04, 201014Year Member
Posts: 88
Reputation Power: 3
hello, this is a tutorial on how to make a hello world console thing in CSharp or C#
first you should have the Microsoft Visual C# 2010 express
then your gonna hit new project and then Console Application. Call it Hello World and click OK
now you should have this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hello_World
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}


Now to start adding the code. The place you wanna put that it right here:
static void Main(string[] args)
        {
             RIGHT HERE!
        }


now for the code:)
type:
Console.WriteLine("Hello World!");
that line means that the Console Writes the line "Hello World"

now make a new line and type:
Console.ReadLine();
this pauses the program so it doesnt exit out as soon as it writes the first line you wrote.

The final code should be:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hello_World
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
            Console.ReadLine();
        }
    }
}


so thats it, a VERY basic tutorial on hello world in C#. I have done a kind of chat bot so i might post that too.

If this helped you, please rep:)
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.