Max and min come out wrong, they go to 0's when it outputs ? How do I fix, any solutions??
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
int x, y, z;
int total;
float average;
//Read data into x, y, z
void ReadData(int & x, int & y, int & z); {
{
cout << "Enter three integer numbers: ";
cin >> x >> y >> z;
}
//Comput total of x, y, z
int total;
int ComputSum(int a, int b, int c);
//Compute average of x, y, z
void ComputeAverage(int x, int y, int z);
{ float average = (x + y + z);
//Display total and average
void Display(int total, float average);
{
cout << fixed << showpoint << setprecision(2);
cout << "Total= " << x + y + z << endl;
cout << "Average= " << average / 3 << endl;
}
}
void FindMaxMin(int x, int y, int z, int max, int min);
int max=0,num=0,min=1000;
for (int i=0; num!=1; i++)
{
if(num==-1)break;
if (num>max)
max=num;
if (num<min)
min=num;
cout << "the max and min values of " << x << "," << y << "," << " and " << z
<< " are " << max << " and " << min;
cin.ignore(80, 'n');
}
//Terminate the program
system("pause");
return 0;
}
}