What is the output from this program? #include void do_something(int *thisp, int that) { int the_other; the_other = 5; that = 2 + the_other; *thisp = the_other * that; } int main(void) { int first, second; first = 1; second = 2; do_something(&second, first); printf("%4d%4d/n", first, second); return (0); }

Respuesta :

Answer:

  1  35

Explanation:

* There is a little typo in printf. It should be "\n".

Initially, the value of the first is 1, and the value of the second is 2. Then, do_something(&second, first) is called. The value of the first will still be 1. However, there is a call by reference for second variable. That means the change made by the function do_something will affect the value of the second variable.

When you look at the calculation inside the do_something function, you may see that value of the second will be 35.