Here's the problem: Ask the user for a floating point number until the user enters a negative number or zero. After each number the user enters print the highest and lowest number so far, and the average so far. Do not print the highest, lowest, and average when the user enters a negative number or zero, but just say a friendly "good-bye". Here's what I have so far:
#include "stub.h"
#include <iostream>
using namespace std;
int main()
{
int counter=0;
float highest = 0;
float input = 0;
float lowest;
float sum=0;
int limit;
float average;
for(input>0;counter<=limit;)
{
cin >> input;
sum = sum + input;
counter = counter + 1;
average = sum/counter;
if(input > highest)
highest = input;
if (input < lowest)
lowest = input;
cout << average << " " << highest << " " << lowest << endl;
}
if ( input <= 0)
cout << "Good-Bye" << endl;
cin.ignore(INT_MAX);
return 0;
}
I don't know what I did wrong.