[Solved]-Snippet C Program Shown Include 2 Using Namespace Std 4 Void Print Int 5 Void Swap Int In Q37206775
A snippet of a C++ program is shown below. #include <iostream> 2 using namespace std; 4 void print (int *); 5 void swap (int *, int *; 6 7 const int SIZE 6; 9 int main() 10 int list[SIZE]34,2,43,1,20,19); a. According to the prototype of the print) function, it wi1l accept a parameter via reference. Hence, write a statement that will be line #13 to call the print() function passing the array list. Remember that array name is a reference to address of 1st element of the array. Leave line #12 blank. b. Write the full implementation of the function print to test that it will print all the values in the array. Note that SIZE is a global variable (a constant). Note: You must access the array using the pointer notation. c. According to the prototype of the swap function, it wil1 accept a parameter via reference. Hence, write a statement that will be line #12 to call the swap ( ) function to swap the first element and 5th element of the array Remember that you are passing the reference to two values which happened to be two values from an array. d. Write the full implementation of the function swap to test that it will correctly swap elements specified from the array to be swapped You can test result by viewing the result of calling to the print () function Show transcribed image text A snippet of a C++ program is shown below. #include 2 using namespace std; 4 void print (int *); 5 void swap (int *, int *; 6 7 const int SIZE 6; 9 int main() 10 int list[SIZE]34,2,43,1,20,19); a. According to the prototype of the print) function, it wi1l accept a parameter via reference. Hence, write a statement that will be line #13 to call the print() function passing the array list. Remember that array name is a reference to address of 1st element of the array. Leave line #12 blank. b. Write the full implementation of the function print to test that it will print all the values in the array. Note that SIZE is a global variable (a constant). Note: You must access the array using the pointer notation. c. According to the prototype of the swap function, it wil1 accept a parameter via reference. Hence, write a statement that will be line #12 to call the swap ( ) function to swap the first element and 5th element of the array Remember that you are passing the reference to two values which happened to be two values from an array. d. Write the full implementation of the function swap to test that it will correctly swap elements specified from the array to be swapped You can test result by viewing the result of calling to the print () function
Expert Answer
Answer to A snippet of a C++ program is shown below. #include 2 using namespace std; 4 void print (int *); 5 void swap (int *, int… . . .
OR

