my code is working and displaying as the example in ~cs50/pset1/greedy but it is still giving me errors. Can someone give me some pointers please?
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main(void)
{
int quarter = 25;
int dime = 10;
int nickel = 5;
int penny = 1;
float dollar;
int count = 0;
do
{
printf("O hai! How much change is owed? \n");
dollar = GetFloat();
}
while(dollar < 0);
//converting dollar amount to cents
dollar= dollar * 100;
int amount = round(dollar);
while(amount >= quarter)
{
count++;
amount = amount - quarter;
}
while(amount >= dime)
{
count++;
amount = amount - dime;
}
while(amount >= nickel)
{
count++;
amount = amount - nickel;
}
while(amount >= penny)
{
count++;
amount = amount - penny;
}
printf("%d \n", count);
}