Select the correct option to test your answer:
Computer
Exception Handling In C Sharp
Difficulty: Medium
What will be the output of the following C# code? { int sum = 10; try { int i; for (i = -1; i < 3; ++i) sum = (sum / i); } catch (ArithmeticException e) { Console.WriteLine("0"); } Console.WriteLine(sum); Console.ReadLine(); }
More Computer Questions
Which is a non-standard version of a computing language?
Which menu do you choose to create footer in Office 365?
What will be the output of the following C# code snippet? public class Generic<T> { Stack<T> stk = new Stack<T>(); public void push(T obj) { stk.Push(obj); } public T pop() { T obj = stk.Pop(); return obj; } } class Program { static void Main(string[] args) { Generic<string> g = new Generic<string>(); g.push("C++"); Console.WriteLine(g.pop() + " "); Generic<int> g1 = new Generic<int>(); g1.push(20); Console.WriteLine(g1.pop()); Console.ReadLine(); } }
What is x if x = math.isfinite(float('0.0'))?
Which of the following is called a one-line description of the package?