hi i need some help with adding a bunch of random numbers.
i dont understand how to add them all.
heres the code:
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int i,x;
srand (time (NULL));
for (i=1; i<=10; i++){
x=rand()%10+1;
cout<<x<<endl;
}
system ("pause");
return 0;
}
i wanna know how to add up all 10 random numbers generated from this.
thank you.