For example; if i wanna divide 89 / 25 so the answer is 3 and the remain is 11. how can i get this answer using for loop?

in other words I want it to be displayed like this (3 quarters, 1 dime and 1 penny) can someone please help me with it?

in other words I want it to be displayed like this (3 quarters, 1 dime and 1 penny) can someone please help me with it?

I don't think you'd necessarily need a for loop for that. Here's some pseudo-code:

---

variable 1 = 89 / 25

variable 2 = remainder of (89 / 25)

variable 3 = variable 2 / 10

variable 4 = remainder of (variable 2 / 10)

print "You have " variable 1 " quarters, " variable 3 " dimes, and " variable 4 " pennies."

---

The tutorials can show you all of the mathematical operators you need to code this.

---

variable 1 = 89 / 25

variable 2 = remainder of (89 / 25)

variable 3 = variable 2 / 10

variable 4 = remainder of (variable 2 / 10)

print "You have " variable 1 " quarters, " variable 3 " dimes, and " variable 4 " pennies."

---

The tutorials can show you all of the mathematical operators you need to code this.

Also, it would be helpful in the future if you read this: http://www.cplusplus.com/forum/beginner/1/

This will let you get better answers if you asked your questions the smart way instead of "HELP PLEASE".

And here's the link for the mathematical operators that you need to code for this: http://www.cplusplus.com/doc/tutorial/operators/

Good luck.

This will let you get better answers if you asked your questions the smart way instead of "HELP PLEASE".

And here's the link for the mathematical operators that you need to code for this: http://www.cplusplus.com/doc/tutorial/operators/

Good luck.

Topic archived. No new replies allowed.