0

hello guys I got en error from check50 2022 which you can see it in my screenshot I check it 100 times but I can't resolve the problem can you please help me?enter image description here

#include <cs50.h> #include <stdio.h> #include <math.h>

int main(void) { float dollar; do { dollar = get_float("Enter your change: "); //ask user to input positive float number } while ( dollar<= 0); //imput must longer then 0 int cents = round(dollar * 100); //dollars to cents int coins = 0; //count coins while (cents >= 25) //Quarters 25 cents { cents -=25; coins++; } while (cents >= 10) //dimes 10 cents { cents -=10; coins++;

}
while ( cents >= 5) //nickels 5 cents
{
    cents -= 5;
    coins++;
}
while ( cents >= 1) //pennies 1 cent
{
    cents -=1;
    coins++;

}
printf("You will need at least %icoins\n",coins); //total nimber largest coins returned
}

1 Answer 1

3

Looks like you are using the 2022 version of check against the 2021 version of pset1 cash. The 2022 version of the pset has a new function to implement called get_cents. (There may be other differences, but that jumps off the page).

Be sure to review this guide if you started cs50 in 2021.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .