For some reason, everytime I run my code the result gives me a multiple of 4, is it rounding to 0.25 cents everytime? I checked the code with other users and it seems fine the rounding part...
./greedy Change: 1 Coins used: 4
./greedy Change: 5 Coins used: 20
./greedy Change: 10 Coins used:40
#include <stdio.h>
#include <cs50.h>
#include <math.h>
float in;
int out = 0;
int main(void){
do{
printf("Change: ");
in = get_float();
}
while (in < 0);
//round amount
in = round(100 * in);
while(in >= 25){
in -= 25;
out++;
}
while(in >= 10){
in -= 10;
out++;
}
while(in >= 5){
in -= 5;
out++;
}
while(in >= 1){
in -= 1;
out++;
}
printf("Coins used: %i\n", out);
}