C# Program to print the numbers in the output

C# Program to print the numbers in the output. In this program we can print the number in the output screen. Using the namespace keyword, a scope can be declared. Making use of scopes within the project allows you to better organise your code, as well as creating global-unique classes

using System;

namespace Main
{
class Program
{
static void Main(string[] args)
{
int num = 100;
Console.WriteLine(num);
}
}
}

100

What is uses of namespace keyword in C#

Using the namespace keyword, a scope can be declared. Making use of scopes within the project allows you to better organise your code, as well as creating global-unique classes. SampleClass is defined in two namespaces, one nesting inside the other, in the following example. Your application can be placed in a “named space” created by namespaces. As a result, the C# compiler can make sense of your program’s variable names and other identifiers.

What is uses of class in C#

A class is a blueprint or prototype that is defined by the user and from which objects are created. In essence, a class is a collection of fields and methods member functions that define actions. As the name suggests, property is a member that allows you to read, write, or compute the value of a private field with ease. In reality, properties are special methods called accessors that can be used as though they were public data members.