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
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
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
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.