using System;
class Program
{
static void Main()
{
int number = 10;
bool isNumber10 = number == 10 ? true : false;
Console.WriteLine("Number == 10 {0}", isNumber10);
}
}
using System;
class Program
{
static void Main()
{
Console.WriteLine("what is your First Name ?");
string FirstName = Console.ReadLine();
Console.WriteLine("what is your Last Name ?");
string LastName = Console.ReadLine();
Console.WriteLine("Your Name is {0}, {1} ", FirstName, LastName);
}
}
Below is given a sample program. In this program we have a 3 line of code
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello to the world");
Main1();
}
static void Main1()
{
Console.WriteLine("Hello to Main !");
}
}
At the top , we have declared a namespace System in which Console class is residing.
within Console class WritLine() method is present. Which take an argument as a string and print the message to the out output console screen.
Using
system declaration
•A
namespace declaration , Using System, indicate that you are using the system
Namespace.
•A
namespace is used to organize your code and is a collection of classes , interfaces, structs, enumsand delegates.
•Main Method is the entry point of into
your application.