System Myproject - Examples: Using Namespace Class Static Void

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

/*************************************************************************

* First C# Program Example


*
*************************************************************************/
Example 1

using System;

namespace MyProject.Examples
{
class ExampleOne
{
static void Main()
{
Console.Write("Welcome to this Tutorial");
Console.ReadKey();
}
}
}

-----------------------------------------------------------------------------------------------------------------
Example 2

using System;

namespace MyProject.Examples
{
class ExampleOne
{
static void Main(string[] args)
{
string name; //Variable for storing string value

//Displaying message for entring value


Console.WriteLine("Please Enter Your Good Name");

//Accepting and holding values in name variable


name = Console.ReadLine();

//Displaying Output
Console.WriteLine("Welcome {0} in your first csharp
program", name);

//Holding console screen


Console.ReadLine();
}
}
}

------------------------------------------------------------------------------------------------------------------

You might also like