0% found this document useful (0 votes)
15 views

System Myproject - Examples: Using Namespace Class Static Void

This document contains two examples of simple C# programs. The first program displays the message "Welcome to this Tutorial" and waits for a key press before closing. The second program asks the user to enter their name, stores it in a variable, displays a welcome message with their name, and waits for a key press before closing, demonstrating how to accept user input, store it in a variable, and display it in the output.

Uploaded by

duskoruzicic
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

System Myproject - Examples: Using Namespace Class Static Void

This document contains two examples of simple C# programs. The first program displays the message "Welcome to this Tutorial" and waits for a key press before closing. The second program asks the user to enter their name, stores it in a variable, displays a welcome message with their name, and waits for a key press before closing, demonstrating how to accept user input, store it in a variable, and display it in the output.

Uploaded by

duskoruzicic
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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