Ask Question

Select all that apply. Given the following code fragment, which of the things shown below happen when the statement on line 8 executes?

1 int square (int a) 2 {3 return a * a4 }5 int main () 6 {7 int x = 0; 8 x = square (5); 9 cout << x << endl; 10 return 0; 11 }

+2
Answers (1)
  1. 30 March, 00:32
    0
    A call to function square is made with the argument as 5 and then storing the result in the integer x which was defined above in the line 7. So when function square is called with value 5 the square function will return 5*5 that is 25 as an integer so we have to store it in an integer that was done by assigning it to integer x.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Select all that apply. Given the following code fragment, which of the things shown below happen when the statement on line 8 executes? 1 ...” 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