0% found this document useful (0 votes)
56 views4 pages

V Sxmvym6L8Dw&List Plac325451207E3105: Basic Structure

The document contains code snippets demonstrating basic C# concepts like reading input from the console, writing output to the console, using built-in data types like bool, int, and double. It shows how to get user input as multiple variables, and format output using placeholders. The snippets cover basic program structure, defining and calling methods, and accessing minimum and maximum values of integral data types.

Uploaded by

Rao Ali Shan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views4 pages

V Sxmvym6L8Dw&List Plac325451207E3105: Basic Structure

The document contains code snippets demonstrating basic C# concepts like reading input from the console, writing output to the console, using built-in data types like bool, int, and double. It shows how to get user input as multiple variables, and format output using placeholders. The snippets cover basic program structure, defining and calling methods, and accessing minimum and maximum values of integral data types.

Uploaded by

Rao Ali Shan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

https://www.youtube.com/watch?

v=SXmVym6L8dw&list=PLAC325451207E3105
https://download.freedownloadmanager.org/Windows-PC/Microsoft-Visual-Studio-
2010/FREE-10.0.40219.1.html

BASIC STRUCTURE
1. using System;

class Program
{
static void Main()
{
Console.WriteLine("enter your name");

}
}

2. using System;

class Program
{
static void Main_1()
{
Console.WriteLine("enter your name");

}
static void Main()
{
Console.WriteLine("enter your name");
Main_1();

_____________________________________________________________________________________

READING AND WRITING TO CONSOLE


using System;

class Program
{
static void Main()
{
Console.WriteLine("enter your name");
string username= Console.ReadLine();

Console.WriteLine(" Hello " + username);


}
}

using System;

class Program
{
static void Main()
{
Console.WriteLine("enter your name");

string username= Console.ReadLine();

Console.WriteLine("hello {0}", username);


//Console.WriteLine(" Hello " + username);
}
}

________________________________________________________________________

READING AND WRITING First Name and Second Name

using System;

class Program
{
static void Main()
{
Console.WriteLine("enter your first name");

string first_name= Console.ReadLine();

Console.WriteLine("enter your second name");

string second_name = Console.ReadLine();

// Console.WriteLine("hello {0}", username);

Console.WriteLine(" Hello " + first_name + second_name);

// Console.WriteLine(" Hello " + second_name);

______________________________________________
using System;

class Program
{
static void Main()
{
Console.WriteLine("enter your first name");

string first_name= Console.ReadLine();

Console.WriteLine("enter your second name");

string second_name = Console.ReadLine();

Console.WriteLine("hello {0},{1}", first_name ,second_name);


// Console.WriteLine(" Hello " + first_name + second_name);
// Console.WriteLine(" Hello " + second_name);
}
}

BUILD IN TYPES IN C#
using System;

class Program
{
static void Main()
{

Bool b=true;

}
}

____________________________
using System;

class Program
{
static void Main()
{

int i=0;

Console.WriteLine(“min={0}”, int.MinValue);
Console.WriteLine(“max={0}”, int.MaxValue);
}

___________________________

using System;
class Program
{
static void Main()
{
double d = 234.322;
int a = 1222;
Console.WriteLine(a);
Console.WriteLine(d);
}
}

You might also like