Ask Question
1 January, 23:08

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); }

+2
Answers (1)
  1. 2 January, 02:49
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What is the output from this program? #include void do_something (int * thisp, int that) { int the_other; the_other = 5; that = 2 + ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers