-- hi im running into a problem with my code. It's executed pretty well with many inputs except for 0.41 and 0.01. It didn't print out any answer but just ran indefinitely...
#include <stdio.h>
#include <cs50.h>
#include <math.h>
int main(void) {
float money;
do {
money = get_float("Change owed: ");
}
while (money < 0.00);
int x = round(money * 100);
int c = 0;
while (x >= 25) {
c = c + floor(x / 25);
x = x % 25;
}
while (x >= 10) {
c = c + floor(x / 10);
x = x % 10;
}
while (x >= 5) {
c = c + floor(x / 5);
x = x % 5;
}
while (x >= 1) {
c = c + floor(x / 1);
}
printf("%i\n", c);
}