1. why do you need globals?
2. scanf("%f", &amount);
%f is for floats, %lf - is for doubles in the scanf format strings
3. %6.2d\n", quarters
%d is for ints, %f is for floats/doubles in the printf format strings
Printable View
1. why do you need globals?
2. scanf("%f", &amount);
%f is for floats, %lf - is for doubles in the scanf format strings
3. %6.2d\n", quarters
%d is for ints, %f is for floats/doubles in the printf format strings
You might find it useful to read about the modulus operator (%).
http://www.cprogramming.com/tutorial/modulus.html
Also, it might be worth trying to describe in sentences (not code) what steps you must take to solve the problem.
Lastly, are doubles the best type of variable to store your results?
I barely even know what I'm doing...Asking me questions isn't helping me, I'm just going to reread my book and hopefully get answers. I know you guys are trying to help though, thanks for the effort.