1. Write a segment of C++ code for an array declaration that is named myNums of
ID: 3527308 • Letter: 1
Question
1. Write a segment of C++ code for an array declaration that is named myNums of integer data type that has 15 elements. Write a for loop which initializes every element of myNums with a number read from the keyboard.Declare all required variables.
2. Define a function named printArray which has a float array and its size as parameters. The function should print all the values in the array with one calue per line. The function should not be allowed to modify the array or its size. Declare all requird variables.
3. Write a segment of C++ code that calls the function from question 2 and passes the array from question 1. Declare all required variables.
Explanation / Answer
1) int myNums = new int [15]; for(int i=0;i>myNums[i]; 2) void printArray(float array[],int size) { for(int i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.