1. Course
  2. Flow controls B
  3. Infinite divisions

Infinite divisions


Last updated: 8/22/2020 Difficulty: Intermediate

Write a program in C# that asks the user for two numbers and shows the division and the rest of the division. Notify if 0 is entered as the second number and end if 0 is entered as the first number.

Input

6
0
20
10
5
5
0

Output

You cannot divide by 0
The division is 2
The rest is 0
The division is 1
The rest is 0
Goodbye!

Solution

Flow controls B

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.

Advertising