|
|
CountFour-v3: using a helper function to manipulate integer inputs
File Details
| Downloads: |
101 |
File Size: |
2.7kB |
| Posted By: |
davidw |
Views: |
83 |
| Date Added: |
Thu, Jan 10 2008 |
|
In this program, the user is prompted to enter four numbers in the console. The program then totals all the positive and negative numbers separately and counts how many positive numbers, negative numbers and zeros were entered. This program shows how a simple helper function can eliminate repetitive code by maintaining totals and counts of multiple user inputs of integers, by establishing a global variable.
|
|
|