I created a program based on the instruction below, but do not know about this pointer, subroutine and Void issue. Can someone fix my C++ base on the below instuctions: This way I know how to do it. Please write it. If you tell me what to replace, I will be lost.
Thank you so so much
Write a program that finds the minimum and maximum value of an array with 10 numbers of your choice.
You need to use a subroutine that takes as argument the array, the size of the array, and the pointers to two variables for the min and the max. To pass an array to a subroutine you need to define it as
void find_min_max(float list[], int size, float *min, float *max){
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int numbers[10];
int smallest=0;
int largest=0;
int temp=0;
}
for (int i=0; 1<10; i++)
{
cout<<"please enter number"<< i +1<< ":" << endl;
cin>> numbers[1];
}
smallest=numbers[0];
largest=numbers[0];
}
for (int i=0; 1<10; i++)
{
temp=number[i];
if (temp<smallest)
smallest-temp;
if (temp>largest)
largest=temp;
}
cout<<"largest number is:" << largest<< endl;
cout<<"smallest number is:" << smallest<< endl;