Consider four coins, 25 cents, 10, 5, and 1. Construct a C program that asks the user how much he wants to get back, and then prints out the amount of coins needed to pay the change, number of coins. The program should have a loop that forces the user to enter a positive value.
source:
#include <cc50.h>
#include <stdio.h>
int main (void)
{
int a = 25;
int b = 10;
int c = 5;
int d = 1;
float f = 0;
do
printf("Quanto de troco deseja receber? ");
f = GetFloat();
while ( f < 0 );
if ( f == 0 )
printf("Obrigado volte sempre!\n");
if ( f > 0 )
printf("Este troco exige %.2f moedas.\n", f);
}