Page 1 of 1

Problem 3) Let the function fun be defined as: int fun (int k) { *k += 6; return 4 * (**); } Suppose fun is used in a pr

Posted: Fri May 20, 2022 6:52 pm
by answerhappygod
Problem 3 Let The Function Fun Be Defined As Int Fun Int K K 6 Return 4 Suppose Fun Is Used In A Pr 1
Problem 3 Let The Function Fun Be Defined As Int Fun Int K K 6 Return 4 Suppose Fun Is Used In A Pr 1 (60.24 KiB) Viewed 30 times
Let the function fun be defined as:
Suppose fun is used in a program as follows:
void main(){ inti=10,j= 20, sum1, sum2; sum1 = (i / 2) +
fun(&i); sum2 = fun(&j) + (j / 2); }
What are the values of sum1 and sum2 if
a) operands in the expressions are evaluated left to right?
b) operands in the expressions are evaluated right to left?
Problem 3) Let the function fun be defined as: int fun (int k) { *k += 6; return 4 * (**); } Suppose fun is used in a program as follows: void main() { int i = 101 j = 20, sumi, sum2; suml = (i / 2) + fun (&i); sum2 = fun (&j) + (j / 2); } What are the values of sum1 and sum2 if a) operands in the expressions are evaluated left to right? b) operands in the expressions are evaluated right to left?