Question: Consider the following program: void Swap (int valuel, int value2) { int temp = valuel; value] = value2; value2= temp; } int main() {
Consider the following program: void Swap (int valuel, int value2) { int temp = valuel; value] = value2; value2= temp; } int main() { int Arryalnt []= {1, 2, 3, 4, 5); int varl = 0; int var2 = 1; int index = 3; Swap(vari, Arryalnt[var2]); Swap(AryaInt[index], Arryalnt[varl]); cout < < "After Swap by value:" < < endl; cout
Step by Step Solution
There are 3 Steps involved in it
Lets analyze each parameterpassing method for the given program a Passed by value In the Swap functi... View full answer
Get step-by-step solutions from verified subject matter experts
