Ask Question

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

+3
Answers (1)
  1. 4 March, 08:02
    0
    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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers