Modify the program so that it passes the age variable by


In this exercise, you experiment with passing variables by value and by reference. (The answers to TRY THIS Exercises are located at the end of the chapter.)

a. Follow the instructions for starting C++ and opening the Try This10.cpp fi le. The fi le is contained in either the Cpp6\ Chap10\Try This10 Project folder or the Cpp6\Chap10 folder. Notice that the main function passes the age variable by value to the get Age function.

b. Run the program. When prompted to enter your age, type your age and press Enter. The message that appears should contain your age; however, it contains the number 0 instead. This is because the age variable is passed by value to the get Age function.

c. Modify the program so that it passes the age variable by reference to the get Age function. Save and then run the program. When prompted to enter your age, type your age and press Enter. This time, the message contains your age

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Modify the program so that it passes the age variable by
Reference No:- TGS01594520

Expected delivery within 24 Hours