Page 1 of 1

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

Posted: Fri May 20, 2022 6:50 pm
by answerhappygod
Problem 3 Let The Function Fun Be Defined As Int Fun Int K K 6 Return 4 K Suppose Fun Is Used In A P 1
Problem 3 Let The Function Fun Be Defined As Int Fun Int K K 6 Return 4 K Suppose Fun Is Used In A P 1 (49.92 KiB) Viewed 45 times
Let the function fun be defined as:
int fun(int* k) {
*k +=
6; return 4 *
(*k);
}
Suppose fun is used in a program as follows:
void main()
{ int i = 10, j = 20, sum1, sum2; sum1
= (i / 2) + fun(&i); sum2 = fun(&j) + (j /
2); }
What are the values of sum1 and sum2 if
Problem 3) Let the function fun be defined as: int fun (int* k) { *k += 6; return 4 * (*k); } Suppose fun is used in a program as follows: void main() { int i = 10, j = 20, sumi, sum2; sum1 = (i / 2) sum2 = fun&j) + (j + fun (&i); / 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?