1. ## storing numbers

Code:
```#include <stdio.h>

int main
{
int number, largest;
int counter = 0;

while ( counter <= 10 ) {
printf( "Enter Number: " );
scanf( "%d", &number );

number = largest;
if ( largest > number )
largest = number;

counter++;
}

printf( "Largest Number was: %d", number );
return 0;
}```
Hi, im not sure how to store numbers precisely, all i wanted to do was compare numbers on input and store/output the largest number that was inputted. It just outputs a bunch of numbers.

Thanks

2. You may be storing the largest, but at the end, you're just displaying number and not largest.

Furthermore, you just want to do:
Code:
```scan value into 'number'
if( number > largest )
largest = number```
Your problem is that you're overwriting the 'largest' value every time in your loop without caring what's in it. See:
Code:
```number = largest;
if ( largest > number )```
The if check will never be true, because you've just set largest and number to hold the same value.

Quzah.

3. You need to shuffle things around a little, read the first number outside of the loop and assign it to largest, then go into the loop and do your tests. It's also better to use a for loop when you know exactly how many times you're going to repeat. You also want to print largest at the end instead of number.
Code:
```#include <stdio.h>

int main(void)
{
int number, largest;
int counter = 0;

printf( "Enter Number: " );
fflush(stdout);
scanf( "%d", &number );

largest = number;

for (counter = 0; counter < 10; counter++)
{
printf( "Enter Number: " );
fflush(stdout);
scanf( "%d", &number );

if ( number > largest )
largest = number;
}

printf( "Largest Number was: %d\n", largest );

return 0;
}```

4. hi Cela, i didnt understand the (stdout) part, what does that function actually do? Well ive solved my problem by just initializing the first number on input as the largest number. And then using this as the comparison number on the next input in the loop. This was a better method i think.

Thanks.

Code:
```#include <stdio.h>

int main(void)
{
int number, largest;
int counter = 0;

printf( "Enter Number: " );
scanf( "%d", &largest );

while (counter <= 9 )
{
printf( "Enter Number: " );
scanf( "%d", &number );

if ( number > largest )
largest = number;
counter++;
}

printf( "Largest Number was: %d\n", largest );

return 0;
}```

5. ## A little bit about fflush()

The fflush() function causes any buffered output data for stream to be written to file. If any data is written, the file's associated st_mtime and st_ctime values are marked for update. The stream remains open.

If stream is a null pointer when calling fflush(), all streams opened for writing or update are flushed.