Calculate the exact change (coins) that needs to be given. Program prompts user
to input an integer which represents the total cents (change) that needs to be
distributed. If a negative value is entered, program terminates. Program then
calculates and prints the most efficient combination of quarters, nickels, dimes and pennies.
I was wondering if i could change a code from my previous hw to get the result. The code is the following:
#include <iostream>
using namespace std;
int main () {
int quarter , dime , nickles, cents, total;
cout << "How many quarters do you have " ;
cin >> quarter;
cout << "How many dimes do you have " ;
cin >> dime;
cout << "How many nickles do you have " ;
cin >> nickles;
cout << "How many cents do you have " ;
cin >> cents;