this is my first question here so sorry if I do it wrong. My code compiles (it´s not finished yet), and it prompts, but when I run ./cash and type a number, It always gives me 0 coins, no matter what number I type in.
This is my code so far:
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main (void)
{
// Get change owed
float owed;
do
{
owed = get_float("Change owed: ");
}
while (owed < 0);
//Convert dollars into cents
{
int cents = round(owed * 100);
{
printf("%i\n", cents);
}
//Track of change still owed
//Track of coins used
int coins = 0;
float quarter = 0.25;
float dime = 0.10;
float nickel = 0.05;
float penny = 0.01;
while (quarter < coins)
{
cents = (cents - quarter);
coins++;
}
{
printf("Total coins:%i\n", coins);
}
}