Ask Question
4 February, 16:32

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 }

+1
Answers (1)
  1. 4 February, 17:07
    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?