Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Code in C++ !! ttu.blackboard.com Online Jaypee Institute of Information Technol

ID: 3586151 • Letter: C

Question

Code in C++ !!

ttu.blackboard.com Online Jaypee Institute of Information Technology TutorI Anupreksha S. Tutors pid-3015370-dt-content-rid-15933998 icourses/201827-ECE-1305-002/ECE-1305... 9) The program below has particular declarations and definitions in its functions: it uses the passing value by reference logic. Without the &'s the program would simply display the x and y values at the cout (try it if you doubt it). Even though these are void functions, there is an interesting output because the values are passed from one function to the other. What is the output of the program? Briefly explain your answer of what happens in functions f1 and f2. #include using namespace std; void fl(int& z, int& q) void f2(int& a, int& b) int main ) intx-13, y8 f2(y,x) return 0 void f1(int& z, int& q) int temp: z temp ; void f2( int& a, int& b) if(a

Explanation / Answer

9)

output:

-13 -13

explanation:

in function f2

//here a is greater than b...so

a(reference to y in main) value is updated with b(reference to x in main)

means y value is also -13 in main..

//in function f1

values of z and q are swapped

10)

output:

44
33
22
11
00
//
..
--
,,

output:

here x (reference of u)value is 2

and y (reference of v) value is 52//indecimal

y-i = 52-i

string(x,y-i) prints x times the ascii character whose value is y-i

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote