Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Consider the following program. #include using namespace std void summer(int&, int); void fall(int, int&) int x int main) int intNum1 2; int intNum2 #

image text in transcribed
image text in transcribed
2. Consider the following program. #include using namespace std void summer(int&, int); void fall(int, int&) int x int main) int intNum1 2; int intNum2 # 5; x 6 summer(intNum1, intNum2); fall(intNum1, intNum2); return O; void summer(int& a, int b) int intNum1 intNum1 b + 12; a 2 b+5; b = intNum 1 + 4; void fall(int u, int& v) int intNum2 intNum2 X v intNum2 4; Answer the following questions: a. What is the output? Consider variable scope. Considering the function summer, parameter 1 is called by reference. What is passed into the function for parameter 1, i.e., what value does parameter 1 receive? b. 2 is called by value. What occurs in memory for parameter 2 and local variable int intNum1? Hint: consider memory, parameters and local variables c. Again, considering the function summer, parameter

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions