Hi...I want to use try block and finally block..with out using catch block.
I am able to execute finally block when i am using cntr+F5.....But not when directly using F5..Is it Manditory to use cntrl??????
My code is below.....
public void Ex()
{
try
{
Console.WriteLine("enter the first number");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("enter the second number");
int b = int.Parse(Console.ReadLine());
int c = a / b;
Console.WriteLine("the value is:" + c.ToString("c"));
}
finally
{
Console.WriteLine("Finally block is executed");
}
}
Jayesh AgrawalPosted Apr 1, 2018, 12:54 PM
harry codePosted Apr 1, 2018, 12:42 PM
Jayesh AgrawalPosted Apr 1, 2018, 12:39 PM
harry codePosted Apr 1, 2018, 11:38 AM
harry codePosted Mar 31, 2018, 12:44 PM
Jayesh AgrawalPosted Mar 31, 2018, 12:31 PM
harry codePosted Mar 31, 2018, 11:44 AM
harry codePosted Mar 31, 2018, 10:55 AM
Jayesh AgrawalPosted Mar 31, 2018, 8:19 AM