Change Value After Declaration in C#

Change value after declaration in C#. In this program we can print the numbers value which is reassigned or declared in the C sharp. In the declaration of a variable, you tell the compiler the name of the variable, its type, and if it has an initial value. is a declaration of a variable’s properties. When it comes to variables, the definition of the variable tells us how it is stored.

using System;

namespace Main
class Program
static void Main(string[] args)
int num = 1;
num = 2;




Console.WriteLine() in C#

In the System namespace, Console is a class that is already defined. When it comes to the Console Class, Write() and WriteLine() are both methods. Instead of printing a new line, Write is used to output data. While printing a new line, WriteLine prints data.

Integer Datatype in C#

Numbers are frequently used in C#, and integers are one of the most commonly used types. An integer is a number that has no fractional part – it is a whole number.

Why Datatypes are Important in C#

A strongly-typed programming language, C# has data types such as integer, character and float that are predefined as part of the programming language, and all constants and variables defined for a given programme must be described with one of the data types in order to run.