title: Sum of prime numbers below 500
body: <p>I made the following code:</p>
  
  <pre><code>  1 #include&lt;stdio.h&gt;
    2 #include&lt;stdbool.h&gt;
    3
    4 bool c[500];
    5 void main()
    6 {
    7  int i,n=1,j;
    8  for (i=2; i&lt;500; i++)
    9  {
   10         if (!c[i])
   11         {
   12                 printf("%d is the prime number %d\n", i,n);
   13                 n++;
   14                 j=2;
   15                 while (j*i&lt;500)
   16                 {
   17                         c[j*i]=1;
   18                         j++;
   19                 }
   20         }
   21  }
   22 }
  </code></pre>
  
  <p>It displays the prime numbers below 500; now, how can I also make the program display the sum of all those numbers(all the prime numbers below 500) in just a few lines?thanks for your help, I'm new to C</p>