I'm having trouble with the equations needed. we have learned the loops so far and i think this problem wants me to use the loops, and it looks like i need if-else as well. Here is the problem.
Write a program that asks the user to supply three positive integers k, m and n, with k being greater than 1. the program should compute the sum of all the integers between m and n that are divisible by k.
I don't know how to tell C that that i only want an integer evenly divisible by another. and then, i'm not quite sure how to get the addition of those integers done.
2007-08-09
09:24:19
·
3 answers
·
asked by
Julia D
3
in
Computers & Internet
➔ Programming & Design
doh! forgot about modulus, and thanks for giving me another example of how to utilize the remainder. I didn't quite see why I would need it before.
2007-08-09
09:33:57 ·
update #1