When you use a calculator to add up a group of numbers, you keep a running total and don't clear the total after each number is added. The same with a program that is to total some values. You add...
Type: Posts; User: Norm
When you use a calculator to add up a group of numbers, you keep a running total and don't clear the total after each number is added. The same with a program that is to total some values. You add...
You haven't explained what the problem with the output is.
If the problem is the 0, its due to integer arithmetic. for example: 6/8= 0
To get decimal places make one of the operands a double: ...
Please copy and paste here the contents of the command prompt window where you execute the code. It should show the input to the program and what the program prints out.
On windows: To copy the...