
Lesson 9-3: Value-Returning and Void Functions
212 | Chapter 9
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Lesson 6-4, Exercise 1, contains a loop nested within a loop. The outer loop prompts
for and inputs a digit. The inner loop sums the integers from zero through the digit. Rewrite your
solution to this task so that the summing of the digits from zero through the input digit is done in
an int function, SumDigits. The digit should be an input parameter. Rerun your changed version
with the same data. The results should be the same.
Exercise 2: Write a program ...