I wanted to enter the argument in cents parameter so that if the argument(cents) is greater than 25, it will go inside the for loop and after dividing by 25 give the remainder. Now, this remainder is saved as the cent's new value, and if it is still greater than 25 it will go inside the loop and same process happen untill we get the last value of cents, which is less than 25.
Along this, I run this count identifier so that every time the loop run it adds up and and tell me how many times the loop runned.
int calculate_quarters(int cents)
{
// TODO
for(int count=0; cents>=25; count++)
{
cents = cents%25;
}
return cents;
return count;
}
I want to get the value of cent in the end , which is less than 25 and count of how many times loop run.But, every time i run it it gave me this error
undeclared use of identifier 'count'
What I wanted to do suppose, I gave the argument 55 to the function calculate_quarters_, so after running inside the loop, it should give me the value of cents 5 and count is 2 in the end.