Give change


Last updated: 8/23/2020 Difficulty: Intermediate

Create a C# program that simulates a supermarket cash register to return a purchase change. Request the total amount of money you have in the cash register (x) and an integer with the purchase value (y).

You must use 100, 50, 20, 10, 5, 2, or 1 bills and return the change using the larger bills first.

Input

1
100

Output

50 20 20 5 2 2

Solution

Flow controls C

6 / 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