Code in C++ !! ttu.blackboard.com Online Jaypee institute of Information Technol
ID: 3586150 • Letter: C
Question
Code in C++ !!
ttu.blackboard.com Online Jaypee institute of Information Technology Tutor I Anupreksha S. I Chegg Tutors pid-3015370-dt-content-rid-15933998 icourses/201827-ECE-1305-002/ECE-1305... values by reference. What is the output from the following code? 3) a) # includes iost ream» using namespace std; void f(int m, int n, double ); int main) int a-8, b7 double c=3.5; f (a, b, c) f (b, a, c) return 8 void f (int m, int n, double w) n=n-2*m; m=2*m; void Addonetint &y;) int rain) Analyze and test the following example (do not include these results in int x = 18; coutExplanation / Answer
3)
a) output:
-8 7 3.5
-8 7 3.5
explanation:
the copy of the variables a,b,c are passed to function f, in parameter.(call by value..)
so, the values changed in f ,will not affect variables, a,b,c..
hence the same values are printed
b)output:
-8 23 10.5
-54 23 31.5
explanation : in function f, the last two parameters(n,w), takes the address of the variables that are passd
whenever the n,w changed in function, f, the corresponding variable values in main also changes..