Question: Consider the following C++ code: int main() { int i = 17; int k = 31; int &j = i; cout < < k =
Consider the following C++ code:
int main() { int i = 17; int k = 31; int &j = i; cout << "k = " << k<< " i = " << i << " j = " << j << endl; j = k; cout << "k = " << k<< " i = " << i << " j = " << j << endl; } The output of our program is:
k = 31 i = 17 j = 17 k = 31 i = 31 j = 31
Explain the flow of the program and why the output appears as it does.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
