View Full Version : Multiplication Via Addition

09-23-2007, 07:43 PM
I read the rules on homework assignments - yes, this is one. I'm looking for some brainstorming help. The task is to create a program where the user enters two integers, and have them multiply without using the multiplication function. For example, if the user enters 5 and 10, the program is supposed to go 10+10+10+10+10, not 5*10. I have gotten as far getting input from the user. I am thinking of using a while loop for this. Does anyone have suggestions as to the best way to do this with the while statement? Thanks.

09-23-2007, 08:49 PM

09-23-2007, 09:12 PM
I am not familiar with the for() function. Is there a way to use the while loop for this?

09-23-2007, 09:15 PM
Everything you can use a for loop for, you can use a while loop for.