Final answer:
When the code fragment is executed, the output will be 1 8 3.
Step-by-step explanation:
The given function definition is:
void something(int a, int* b) {
inc;
c = a + 2;
a = a * 3;
*b = c + a;
}
When the code fragment is executed:
- The variable r is initialized to 1.
- The variable s is initialized to 2.
- The variable t is initialized to 3.
- The something function is called, passing r and the address of s.
- Inside the something function, a is multiplied by 3, resulting in 3, c is assigned the value of a + 2, resulting in 5, and the value of *b (which is s) is assigned the value of a + c, resulting in 8.
- The values of r, s, and t are printed.
Therefore, the output will be 1 8 3.