c++, what have i done wrong?
<p>I am trying to ask the user for the age of 10 students if they enter anything less than 0 or more than 18 i want it to change that value to 0.</p>

<p>what have i done wrong?</p>

<pre><code>   #include &lt;iostream&gt;
   using namespace std;
   int main()
   int age [10];
   int TotalAge, AverageAge;

   for (int i = 0; i &lt; 10; i++) 
   {
     cout &lt;&lt; "please enter the age of students:";
     cin &gt;&gt; age[i]; 

     if age[i] &lt; 0 || age[i] &gt; 
     cout &lt;&lt; "An error was detected in your input, invalid age"; // print 
     age[i] = 0;
     TotalAge += age[i]; // total age is the sum of age
     AverageAge = TotalAge / 10; 
     cout &lt;&lt; "Average age of class is: " &lt;&lt; AverageAge &lt;&lt; endl
   }
</code></pre>
