Advanced Placement (AP)
Advanced Placement (AP), 21.01.2022 16:30, dice50

C++ - Problem 2: Swap Function
In the main function, create an array called numbers that stores 10 integers. Write a function called swap that
receives the array and two integer index numbers whose values are to be swapped. Your program should
output the original values in the array in a single line with each values separated by a space. You should then
call your swap method providing the array and two index numbers. The swap method should swap the values
in the array at the two index numbers. After the function call, you should display the values of the array again
showing that the two values were swapped.
Below is a sample run of the program with the 3rd and 4th index values being swapped.
21 45 78 11 36 62 19 24 93 48 //11 and 36 in original positions
21 45 78 36 11 62 19 24 93 48 //11 and 36 after swapping positions.

answer
Answers: 3

Other questions on the subject: Advanced Placement (AP)

image
Advanced Placement (AP), 24.06.2019 08:00, tayleeanntabeln2097
What are the countries in south asia?
Answers: 1
image
Advanced Placement (AP), 24.06.2019 09:00, albattatasraap5wymy
Based on what you've learned about the professions, which ones appeal to you as a potential career and why? if none interest you as a future career, indicate another career you're interested in and explain why that career interests you.
Answers: 1
image
Advanced Placement (AP), 25.06.2019 20:00, phavion
Long-term alcohol use can cause major depression. a. true b. false
Answers: 2
image
Advanced Placement (AP), 26.06.2019 10:30, kekoanabor19
Which control would most likely achieve the greatest reduction of noise pollution? limiting airplane traffic insulating buildings and homes reducing road and highway traffic using headphones to listen to music building noise barriers beside highways
Answers: 1
Do you know the correct answer?
C++ - Problem 2: Swap Function
In the main function, create an array called numbers that sto...

Questions in other subjects: