Commit 87141ec9 authored by Dominik Widhalm's avatar Dominik Widhalm
Browse files

Improved output of task 4.07

parent 9e27c52d
......@@ -83,8 +83,12 @@ int main (void) {
/* Output the resulting amount of coins */
printf("\nFor a deposit of %3.2fEUR you get ...\n",cash);
for (int i=0; i<5; i++) {
/* Check if there are coins of the current value */
if (coins[i] > 0) {
/* Print the current number of coins */
printf("... %d coins of value %1.2fEUR\n",coins[i],((double)coin_value[i]/10.0));
/* Notify the user about the termination of the program */
printf("\nThe program will now be terminated...\n");
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment