Types of error

Errors are the problems or the faults that occur in the program, which makes the behavior of the program abnormal, and experienced developers can also make these faults. Programming malfunctions are also known as the bugs or faults, and the process of removing these bugs is known as debugging. There are 2 types of error, we'll study both in detail below

CODE

EG 1 . Assigning value to a variable without declaring

static void Main(string[] args) {
    age = 30; //Error
    Console.WriteLine(age);
}



EG 2 . Getting number from user

static void Main(string[] args) {
    Console.Write("Enter Number : ");
    int num = Convert.ToInt32(Console.ReadLine());
}