Lab: Function Practice
- Write a function that requests ten integers from the user and prints
their average
soln
- Write a function that requests ten integers from the user and returns
their average
soln
- Write a function that prompts the user to enter two positive integers and
returns their greatest common divisor. The greatest common divisor of 16 and 24 is 8.
-
If two numbers (num1 and num2) are entered, check integers from 1 up through the lower of num1 and num2 to see if the integer divides evenly into both num1 and num2. Note, 1 is a common divisor of all numbers
- Modify the above function so that the main program prompts the user for the integers and calls the function with those integers.
- Modify the GCD function to return a void and use a reference parameter
for the answer
- Move all functions to after the main and write function prototypes