If you don't mind Edward giving some constructive criticism, read on.
// This should never be in the global scope
using namespace std;
// Global variables should be avoided when possible
int number, sum = 0;
The effect of using namespace std; is limited to the scope that you do it in. If you do it in main, it only has an effect in main. If you do it in a namespace, it only has an effect in that namespace. If you do it in the global scope, it has an effect everywhere, even if you don't want it to.
Global variables are the same way. They can be seen and used everywhere, and that makes keeping track of them harder. Even if you only use them in small programs like this one, it's still better to keep to the habit of limiting variable scope as much as possible.
// you can put the endl right away or use "\n"
There's more to it. endl automatically flushes the stream each time you use it and '\n' or "\n" doesn't. If you don't need the stream flushed, don't bother with endl. In fact, Ed's experience is that most of the time you don't need the stream flushed because a required flush usually happens automatically with tied input streams, the unbuffered effect of "real-time" streams, or the natural lifetime of your stream object.
So Ed's recommendation is to always use '\n' or "\n" instead of endl, and flush if it turns out that you find one of the rare situations where it's needed.
This line doesn't do anything. In the else body, number is compared with 0 and the result is thrown away. The parentheses are the confusing factor because else doesn't have a condition, but any expression can be surrounded in parentheses. This is what actually happens:
if (number < 0) {
cout << "...";
}
else {
(number >= 0); // No effect
}
sum += number;
>float mean = 1. * sum/10.;
This won't make the warning go away because floating point constants have a type of double, not float. To make it a float you need to add an f or F suffix or cast the value to float:
float mean = 1.f * sum/10.f;
// or
float mean = float(1.) * sum/float(10.);
scanf is declared in <cstdio> or <stdio.h>. It's also a varargs function which means that if you don't provide a prototype the behavior is undefined. Be sure to include either of those headers to fix the problem.
Edward would also suggest that this line is confusing because the behavior is unconventional. If you type any whitespace and/or press enter, nothing happens. If you type anything except whitespace and then press enter, the program ends, but only after that combination. The two most common keys typed when someone says "press any key" are the space bar and the enter key, so users would be stumped by how
scanf("\n") works.