Question: Write a complete C + + program with a f unction called arrayFun that takes an 1 D integer array of user - specified size
Write a complete C program with a f
unction called arrayFun that takes an D integer array of
userspecified size and finds the sum,
average, and largest and smallest of the numbers stored in the array.
Create an integer array and initialize it to random integers in the main f
unction.
Pass this array to arrayFun and print the results of the arrayFun operations to the monitor.
Example main f
unction that uses arrayFun:
int main
int size;
cout "How many numbers to enter? ;
cin size;
int numssize;
cout "Enter numbers: ;
forint i ; i size; i
cin numsi;
arrayFunnums size; prints sum, average, largest and smallest of elements in nums
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
