On MSDN, this code is posted at https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/try-catch I am unable to understand why it throws the error:
If you look at the article, you'll see the answer:
// Error: Use of unassigned local variable 'n'.
When you write int n; you do not initialize variable and try to use it in Console.Write(n);, so you will get compilation error: https://ideone.com/q3LXwl