Consider the following C program: int fun(int *i) { *i += 5; return 4; } void main() { int x = 3; x = x + fun(&x); } What is the value of x after the assignment statement in main, assuming a. operands are evaluated left to right. b. operands are evaluated right to left

Answer :

Answer:

a. operands are evaluated left to right

7

b.operands are evaluated right to left

12

Explanation:

for a

x value is 3 and function returning 4 so total 7

for b

function value returning 4 and it also changes x value to 8

so when we add both it is 12

Other Questions