Passing by Value

Passing by Value

use the program, Passing-by-Value, on pp. 261 of the text and the program, Passing-by-Reference, on pp. 268 as a starting point for this assignment. 

Write a similar program, but change the code to pass two variables to the function call rather than one. 

Answer the following questions after completing both programs:

•What is the purpose of the function header?

•How may you identify the body of a function?

•What does the return statement do? 

Note. Do not combine these programs into one program. 

Value received = 3 incr10(num) = 13 num = 13 Value received = 6 incr10(value) = 16 value = 16   
Powered by