good day to you....
I've been searching this code which computes the product of two numbers using addition...this problem is so confusing...what code did you used in this program?
I hope it will reply very soon...thanks
This is a discussion on product using adition within the C++ Programming forums, part of the General Programming Boards category; good day to you.... I've been searching this code which computes the product of two numbers using addition...this problem is ...
good day to you....
I've been searching this code which computes the product of two numbers using addition...this problem is so confusing...what code did you used in this program?
I hope it will reply very soon...thanks
Think about it for a minute.. How do you multiply numbers together on paper?
What's 4 multiplied by 5...?
well, its 4 + 4 + 4 + 4 + 4
.. the number 4 added together 5 times
or, 5 + 5 + 5 + 5
the number 5 added together 4 times
If you want to perform an operation a certain number of times, then use a loop... Read here for more information
http://www.cprogramming.com/tutorial/lesson3.html
what type of loop do you used in this program?
for
while
do
Think about it for 5 minutes - OK ?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
in this case, what code (in a for loop pattern) satisfies the problem?
What are your ideas on that question?
it's about the program which input two numbers and get the product of it using adition
I mean, what are your ideas on what code (in a for loop pattern) satisfies the problem?
for example:
Think about it for a minute.. How do you multiply numbers together on paper?
What's 4 multiplied by 5...?
well, its 4 + 4 + 4 + 4 + 4
.. the number 4 added together 5 times
or, 5 + 5 + 5 + 5
the number 5 added together 4 times
Is that your answer to my question? I want to know what you think, not a copy and paste of what somebody else said.
The point is that you make some effort to solve the problem, and we help you figure out where your thinking is wrong or can be improved. If you have a question for us, then I'm asking you to give your thoughts on that question first, so they can be responded to.
what code satifisfies this problem?
What Salem and Daved are getting at is that no one here is going to spoon feed you this code. Please try to work this out on your own, then post the code and what problems you are having. If you do not understand the for loop, look at the tutorial again, read it carefully, and post what questions you have concerning the for loop structure. Once you understand the for loop structure, try to apply it to what Bench82 said. Post your efforts to the board and we'll help you solve specific problems with what you're doing.
[edit] beaten, took too long making it polite...[/edit]
There is a difference between tedious and difficult.
my code is found in my flash disk... do you want to show it?
Yes, we'd like to see what you have accomplished so far.
There is a difference between tedious and difficult.