I just started class about 4 wks ago. I just got my deitel's c++ how to program book and I already cannot figure out how to do this homework assignment... (I got shiested online...getting refund, just had to purchase book late.)
use a while statement to determine and print the largest number of 10 numbers input by the user. The program should use three variables:
counter: A counter to count to 10, (to keep track of how many numbers have been input and to determine when all numbers have been processed.)
number: the current number input to the program
Largest: The largerst number found so far.
Now..from what I have, I don't quite understand how to put the while loops to find the largest # out of the 10 entered....heres what I have after working on this for 3 hrs!!! I got an error message on the while part...on that line. I've got a headache too!
as im reading...i think what i can't find is where to assign the values to the counter (if im saying that right)...
Thanks!
ps...IM NEW I SAID!!! DON'T BE LAUGHIN.....:lol:
#include <iostream>
using namespace std;
int main ()
{
int counter;
int larger;
int number;
if ( number < 10 )
cin << largest < number;
while
{
cout << "enter your number: " ;
cin >> number;
}
//end of while loop
return 0;
}