Code:
using system :
class err
{
public static void main ()
int x = 10;
int y = 5;
int z = 5;
int a = x/(y-z);
Console.WriteLine(" the result of the given expression is " +a);
}
The above code will result in a run time error , while you can see that it will generate into a run time error since the expression includes division by zero , as the difference between the y and z variables results in zero and it divides the value stored in variable x, since the any value divided with zero results in a not defined value , it will generate an exception. you will have to catch those exception.
Bookmarks