I don't know what is wrong with my code. I keep inputting 0.41 and getting 8 as the answer.
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main(void)
{
float x;
do
{
printf("How much change is owed? ");
x = GetFloat ( );
}
while (x < 0);
int y = roundf(x*100);
int z = 0;
while (y >= 25)
{
z++;
y = y - 25;
}
while (y >= 10)
{
z++;
y = y - 10;
}
while (x >= 5)
{
z++;
y = y - 5;
}
while (y >= 1)
{
z++;
y = y - 1;
}
printf("%d\n", z);
}