...

View Full Version : Multiplication Via Addition



htdefiant
09-23-2007, 08: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.

Inigoesdr
09-23-2007, 09:49 PM
for()

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum