Want to build the ChatGPT based Apps? Start here
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
harry code
2.1k
124
18.5k
Using finally block woth out catch block
Mar 31 2018 7:50 AM
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");
}
}
Reply
Answers (
9
)
Need clarification on xmldocument,xmlelement,xelement,xmlnod
c# doubt . database connection problem