diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-04 04:01:31 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-04 04:01:31 +0000 |
commit | 4ecca707ed8d938397eb3d84a7f3408e240809c7 (patch) | |
tree | d738000e0432a2350f29558efec5c2178020e2bb /wk1/pset1/cash/cash.c | |
parent | 7163a5c998a611bd4d0397da6d605cdf7fdceaa7 (diff) |
Sun, Dec 3, 2023, 8:01 PM -08:00
Diffstat (limited to 'wk1/pset1/cash/cash.c')
-rw-r--r-- | wk1/pset1/cash/cash.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/wk1/pset1/cash/cash.c b/wk1/pset1/cash/cash.c index 3f561b5..eda145e 100644 --- a/wk1/pset1/cash/cash.c +++ b/wk1/pset1/cash/cash.c @@ -37,9 +37,10 @@ int main(void) int get_cents(void) { + int i; do { - int i = get_int("How many cents? "); + i = get_int("How many cents? "); } while(i <= 0); return i; @@ -53,18 +54,17 @@ int calculate_quarters(int cents) int calculate_dimes(int cents) { - // TODO - return 0; + cents = cents / 10; + return cents; } int calculate_nickels(int cents) { - // TODO - return 0; + cents = cents / 5; + return cents; } int calculate_pennies(int cents) { - // TODO - return 0; + return cents; } |