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 AgrawalRank #707 · 3.4K reputationPosted Mar 31, 2018, 4:19 AM EDT
harry code125 reputationPosted Mar 31, 2018, 6:55 AM EDT
harry code125 reputationPosted Mar 31, 2018, 7:44 AM EDT
Jayesh AgrawalRank #707 · 3.4K reputationPosted Mar 31, 2018, 8:31 AM EDT
harry code125 reputationPosted Mar 31, 2018, 8:44 AM EDT
harry code125 reputationPosted Apr 1, 2018, 7:38 AM EDT
Jayesh AgrawalRank #707 · 3.4K reputationPosted Apr 1, 2018, 8:39 AM EDT
harry code125 reputationPosted Apr 1, 2018, 8:42 AM EDT
Jayesh AgrawalRank #707 · 3.4K reputationPosted Apr 1, 2018, 8:54 AM EDT