using System;
public class Program
{
public static void Main()
string val = null;
Console.WriteLine(Convert.ToInt32(val)); // Print 0
// Ex 1 : Remove 3 lines below to execute Ex 2
//FormatException -> 'Input string was not in a correct format.'
string val1 = "786.78";
Console.WriteLine(Convert.ToInt32(val1));
// Ex 2 : Remove 3 lines below to execute Ex 3
//OverflowException -> 'Value was either too large or too small for an Int32.’.
string val2 = "786786786786";
Console.WriteLine(Convert.ToInt32(val2));
// Ex 3
//InvalidCastException -> 'Invalid cast from 'Double' to 'Char'
double val3 = 786.78;
Console.WriteLine(Convert.ToChar(val3));
}