1. Course
  2. Arithmetic
  3. Division by zero

Division by zero


Last updated: 8/22/2020 Difficulty: Easy

Create a C# program that asks the user for two numbers (x, y) and shows the result of their division.

You will have to control division by 0 with the use of the DivideByZeroException exception in a try-catch block. If the user tries to divide by 0, it Cannot be divided by 0.

Input

6
0

Output

Cannot divide by 0

Solution

Arithmetic

4 / 8

Android App


Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty


Learn C# at your own pace, the exercises are ordered by difficulty.

Make a donation


Your donations support our work and contribute to the maintenance of the app.

Advertising