Nov 1, 2019 at 11:47am Nov 1, 2019 at 11:47am UTC
result+= X;
I am only asking if there is any other way to multiply without using this logic
Nov 1, 2019 at 11:50am Nov 1, 2019 at 11:50am UTC
You... you've completely ignored everything keskiverto, lastchance and I have been telling you, haven't you?
Youve already been shown how you can do an addition as a series of ++ operations. Why are you pretending you haven't?
You've already been show how you can do a series of such additions to do a multiplication. Why are you pretending you haven't?
Or is this just an elaborate troll?
Nov 1, 2019 at 11:54am Nov 1, 2019 at 11:54am UTC
No this isn't. I just want a "straight forward" answer to a simple question asked above your post. THATS IT.
Nov 1, 2019 at 11:57am Nov 1, 2019 at 11:57am UTC
You take the technique you've been shown for doing an addition using ++.
You then use an outer loop to do multiple such additions, to perform a multiplication.
How is this not straightforward?
Nov 2, 2019 at 10:56am Nov 2, 2019 at 10:56am UTC
Thanks everyone, now I am stuck on division and remainder using same ops ++ and - -. lastchance need your assistance one last time.
Thanks
Nov 2, 2019 at 11:46am Nov 2, 2019 at 11:46am UTC
Well, if you can do addition, then you can count how many times you can add Y to 0 so as to equal (or, at least, not exceed) X. That will give integer divide X / Y and, with care, a remainder to. Just count your quotient and remainder.
Last edited on Nov 2, 2019 at 11:48am Nov 2, 2019 at 11:48am UTC
Nov 2, 2019 at 12:06pm Nov 2, 2019 at 12:06pm UTC
lastchance can you please provide a sample code for division? I’ll do for remainder.
Nov 2, 2019 at 12:21pm Nov 2, 2019 at 12:21pm UTC
Have a try, yourself. That way you will start to understand loops.
It's not a bad exercise on program control, actually.
Nov 2, 2019 at 12:28pm Nov 2, 2019 at 12:28pm UTC
Actually I am a bit aware of the logic but I am out of city and tonight is the last day to submit this program. Please try to understand. You can get me full marks.
Last edited on Nov 2, 2019 at 12:29pm Nov 2, 2019 at 12:29pm UTC
Nov 4, 2019 at 11:31am Nov 4, 2019 at 11:31am UTC
You're acutally asking us openly to help you cheat on your homework, so you can get a score you didn't deserve?