View Single Post
Old Jan 30, 2007 | 08:46 PM
  #7  
wedley2's Avatar
wedley2
bboy Wesley West
 
Joined: Oct 2003
Posts: 15,390
Likes: 0
From: six-five-o
Default

#include <iostream>
using namespace std;
int main()
{

int num, min, max, n;
double mean, sum = 0, count;

cout << "Enter the amount of numbers to be calculated:" << endl;
cin >> n;


for (count = 0; count < 1; count++)
{
min = 0;
max = 0;
}

cout << " Enter a number to be calculated for minimum, maximum and mean. \n" << endl;
cin >> num ;

for (; num <= n ; num++)
{

if (num > max)
{
num = max;
}
if (num < min)
{
num = min;
}
else
sum += num;

mean = sum/n;

cout << "The maximum number is:" << max << endl;
cout << "\nThe minimum number is:" << min << endl;
cout << "\nThe mean number is:" <<mean<<endl;
}













return 0;
}
// i cant get the max and min to display.
//plus i cant get the for loop to stop at "n"
Reply