When I input an amount into the program cash, it gives me one more coin than I should have and I'm not sure how to fix it
#include <stdio.h>
#include <cs50.h>
#include <math.h>
//Prompt user for the amount of change owed in dollars
int main(void)
{
//Initialize variable 'Change Owed'
float Change;
do
{
Change = get_float("How much change is owed in dollars?: ");
}
//Invalid values for change owed to reprompt user
while(Change <= 0);
//Convert dollars to cents, to the nearest penny
int cents=round(Change*100);
//Initialize coin values
int quarter=25;
int dime=10;
int nickel=5;
int penny=1;
int coins=1;
//Track quarters
while(cents >= quarter)
{
cents=cents-quarter;
coins=coins + 1;
}
//Track dimes
while(cents >= dime)
{
cents=cents-dime;
coins=coins + 1;
}
//Track nickels
while(cents >= nickel)
{
cents=cents-nickel;
coins=coins + 1;
}
//Track pennies
while(cents >= penny)
{
cents=cents-penny;
coins=coins + 1;
}
//Print amount of coins
printf("%i\n", coins);
}