0% found this document useful (0 votes)
6 views1 page

C# Beginner Program Examples

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

C# Beginner Program Examples

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

* First C# Program Example


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

using System;

namespace [Link]
{
class ExampleOne
{
static void Main()
{
[Link]("Welcome to this Tutorial");
[Link]();
}
}
}

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

using System;

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

//Displaying message for entring value


[Link]("Please Enter Your Good Name");

//Accepting and holding values in name variable


name = [Link]();

//Displaying Output
[Link]("Welcome {0} in your first csharp
program", name);

//Holding console screen


[Link]();
}
}
}

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

You might also like