Populating elements of arrays?

Where could I look on figuring out how to populate each element of an integer array with the sum of two dice?
Last edited on
for(int i = 0; i < arrayMax; i++)
{
array[i] = sum;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int roll() {
    return ((rand()%6)+1);
}

int main()
{

  int arr[30];

  srand(time(0));

  for(int i=0; i<30; i++)
    arr[i] = roll()+roll();

}
Topic archived. No new replies allowed.