Step #1: Create a function to output the values of an integer array. You will have two parameters: the array and the number of elements to display.  Step #2: Create an array of integers of 100 elements. File the array with the values 1 to 100 Step #3: Call the function in step 1 to print 6 elements starting at element 0

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false. A double type is an example of a simple data type....
icon
Related questions
Question

C++ and the focus is on Pass by Reference: 

The following steps are essentially under the same problem but in order to complete a step, the previous must be completed first. For example, Step #3 cannot be completed unless Step #1 has been conducted.

Step #1: Create a function to output the values of an integer array. You will have two parameters: the array and the number of elements to display. 

Step #2: Create an array of integers of 100 elements. File the array with the values 1 to 100

Step #3: Call the function in step 1 to print 6 elements starting at element 0

Step #4) Call the function in step 1 to print 6 elements starting at element 12.

Step #5) Write a swap function that will swap two integer parameters that are passed in by reference.   

Step #6) Use the swap function to swap the elements in the 100 element array at element 0 and 5. Display the first 8 elements in the array (using the function in step 1)

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning