Menu

(Solved) : Exercise 1 Consider Following Function Main Int Main Int Iist Array Size 56 34 67 54 23 87 Q30155121 . . .

Void function
Exercise 1:consider the following function main int main() int iist ARRAY-SIZE] = {56, 34, 67, 54, 23, 87, 66, 92, 15, 32, 55, 54, 88, 22, 30); cout<< List elements: printArray (list, ARRAY. SIZE); cout<cendl; cout<< The position of the tirst occureenc of the smallest <element in list is: <<smallestIndex (list, ARRAY SIZE) cendl: cout<< The smallest element in 1?st is: <<list [smallestindex ( 1 ist, ARRAYSIZE)] <cendiccendl; return 0 - 1. Write the definition of the function smallestIndex that takes as a parameter an int array and its size and returns the index of the first returns occurrence of the smallest element in the array 2. Write the delinition of thefunctionprintArray, that prints any one dimensional array of type int. Sample Input/output: List elements: 56 34 67 54 23 87 66 92 15 32 55 54 88 22 30 The position of the firot occureenc of the omallest element in list is:8 The snallest elesent in list is:15 Process returned 0 (0x8) execution time : 0.879 s Press any key to continueExercise 1:consider the following function main int main() int iist ARRAY-SIZE] = {56, 34, 67, 54, 23, 87, 66, 92, 15, 32, 55, 54, 88, 22, 30); cout<< “List elements:” printArray (list, ARRAY. SIZE); cout<cendl; cout<< “The position of the tirst occureenc of the smallest <“element in list is: “<<smallestIndex (list, ARRAY SIZE) cendl: cout<< “The smallest element in 1?st is: <<list [smallestindex ( 1 ist, ARRAYSIZE)] <cendiccendl; return 0 – 1. Write the definition of the function smallestIndex that takes as a parameter an int array and its size and returns the index of the first returns occurrence of the smallest element in the array 2. Write the delinition of thefunctionprintArray, that prints any one dimensional array of type int. Sample Input/output: List elements: 56 34 67 54 23 87 66 92 15 32 55 54 88 22 30 The position of the firot occureenc of the omallest element in list is:8 The snallest elesent in list is:15 Process returned 0 (0x8) execution time : 0.879 s Press any key to continue Show transcribed image text

Expert Answer


Answer to Exercise 1 Consider Following Function Main Int Main Int Iist Array Size 56 34 67 54 23 87 Q30155121 . . .

OR