Question: Computer science question 31) Consider the following program with C like syntax: (8 points) int y[] (0, 1, 1, 2, 3, 5, 8); int n
31) Consider the following program with C like syntax: (8 points) int y[] (0, 1, 1, 2, 3, 5, 8); int n = 0; void baffling(int i) void swap(int i, int j) int t = i; i = j; n n+2 i = i*2 void main)( What would the values of the variables in the above code s (a) All arguments are passed by nippet be for each of the following parameters passing assumptions? value? (assume copies are made for all formal arguments) baffling (n)i (b) All arguments are passed by reference? swap(z, YIz]) (c) All arguments are passed by name swap(z, y[z])i (d) All arguments are passed by value-result? baffling (n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
