#include <iostream>
#include <iomanip>
#include <string>
usingnamespace std;
int main()
{
double n1, n2, n3, i;
char y;
int minimum;
cout<<"This program will calculate the min, max, and mean of a set of three numbers.\n\n";
cout<<"Please enter numbers between 1 and 1000.\n\n";
do{
cout<<"Please enter your first number:\n\n";
cin>>n1;
}while(n1<=0 || n1>=1000);
do{
cout<<"Please enter your second number:\n\n";
cin>>n2;
}while(n2<=0 || n2>=1000);
do{
cout<<"Please enter your third number:\n\n";
cin>>n3;
}while(n3<=0 || n3>=1000);
cout<<"You have entered the following numbers:\n";
cout<<n1<<"\n"<<n2<<"\n"<<n3<<"\n\n";
cout<<"The minimum value is:"<<minimum<<"\n\n";
return 0;
}
//create minimum function
int minimum()
{
int x, y, z;
int lowest, highest;
if (x<y)
{
lowest = x;
highest = y;
}
else
{
lowest = y;
highest = x;
}
if (z<lowest)
{
lowest = z;
}
elseif (z>highest)
{
highest = z;
}
//end of minimum function
}
you have not implemented the function you created. you will need to use your minimum function, and i think with the way you have it set up you will want to have 3 parameters passed to your function so that you can access user input.
1 2 3 4 5
int minimum(int input1, int input2, int input3) //this is your method declaration
return lowest;// the return your method needs
minimum=minimum(n1,n2,n3)//implementation & setting your variable
as for setting minimum to a number you are going to need to have your method a number and have your var = lowest