I'm getting error "Exception has been thrown by the target of an invocation." : <p>I'm learning c# at one site,and i came to this task:
our program should read two integers each from the new line. Then, it should output the sum, difference, product and quotient of these numbers. If the second number is zero, it should answer "Can't divide by zero!" instead of the quotient.
Example 1:</p>

<blockquote>
  <p>12
  4
  16
  8
  48
  3</p>
</blockquote>

<p>Example 2:</p>

<blockquote>
  <p>12
  0
  12
  12
  0
  Can't divide by zero!</p>
</blockquote>

<p>and this is my code:</p>

<pre><code>        int num1 = int.Parse(Console.ReadLine());
        int num2 = int.Parse(Console.ReadLine());

        int sum = num1 + num2;
        int diff = num1 - num2;
        int product = num1 * num2;
        int quo = num1 / num2;


        Console.WriteLine($"{sum}");
        Console.WriteLine($"{diff}");
        Console.WriteLine($"{product}");

        if (num2 == 0)
        {
            Console.WriteLine("Can't divide by zero!");
        }
        else
        {
            Console.WriteLine($"{quo}");
        }
</code></pre>

<p>When second digit isnt 0,it works perfectly,but when it is,I get error  "Exception has been thrown by the target of an invocation."</p>
