Question: 4 . [ 2 5 pts . ] Assume that the main function calls SUB 1 function, and parameter passing methods forformal parameters are as

4.[25 pts.] Assume that the main function calls SUB1 function, and parameter passing methods forformal parameters are as follows: a is passed-by-value, b is passed-by-result, c is passed-by-reference,and, finally, d is passed-by-value-result. What is printed when we run this application? Do not justprint the output. Show all the steps of execution.void SUB1(int a, int b, int c, int d){a = a +1;b = a *2;c =5+ b;d = d +3;}void main(void){int w=1;int x=2;int y=3;int z=4;SUB1(w, x, y, z);print (w, x, y, z);}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!