9/9/23, 5:52 PM Assessment 3: Attempt review
COS1511-23-Y Welcome to COS1511 Module Site Assessment 3
QUIZ
Started on Saturday, 19 August 2023, 3:37 PM
State Finished
Completed on Saturday, 9 September 2023, 5:52 PM
Time taken 21 days 2 hours
Marks 54.00/60.00
Grade 90.00 out of 100.00
Question 1
Correct
Mark 1.00 out of 1.00
What is the output of the following program?
#include <iostream>
using namespace std;
void X(int A, int &B)
{
A = A + B;
B = A - B;
A = A - B;
}
int main()
{
int a = 4, b = 18;
X(a,b);
cout << a << ", " << b;
return 0;
}
a. 4, 4
b. 18, 4
c. 18, 18
d. 4, 18
Your answer is correct.
The correct answer is:
4, 4
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=12400282&cmid=738305 1/36