As mentioned before, if you move the print statement to after the loop, after the calculation is complete, then it should work as expected.
As mentioned before, if you move the print statement to after the loop, after the calculation is complete, then it should work as expected.
Ok, I got it now.
Thanks to everyone that helped me.
well, in the source code you quoted in your other post the condition on the while statement is 'B>0'. If B = 0, then this condition is never met and anything inside the while loop never gets executed. Thats why you don't get anything happening.
The keyboard is the standard device used to cause computer errors!
If the OP cannot do logic on his/her own, then he/she should quit being a programmer. It's that simple.
A programmer--any programmer--MUST be able to structure the code properly.
What we can help with is other types of problems. For example, how does cin work? How do classes work? Why do I get a segmentation fault, etc.
Hahaha. Funny when I see some people ask those questions, they get "check the FAQ", or "Google it".... I feel answering a simple question about something that the OP may understand but overlooked is one of the many reasons for this forum. Now this is getting off topic so i'm done. It's okay though. You keep doing your thing, I will keep doing my. Its all about help and advice.
The keyboard is the standard device used to cause computer errors!
They point to these things because usually something is answered in the FAQ, and we are too lazy to type it out or the FAQ explains it way better. Sometimes a simple search in google yields thousands of links to resources that explains the question, so why not just tell them to google it? Faster for us, and probably even better for them.
If it isn't about a logic question--ie how to structure the code in a certain way, then feel free to provide an answer. But try not to completely solve the problem. After all, they learn by doing. If you guide them along the path, they will learn all the better.