A couple of problems with your program.
1. You're for loop only loops through 6 iterations which is Sides_of_Dice. If you are looking to roll the dice 20 times (20 loop iterations) you should change that constant Rolls_of_Dice, which you aren't using, to 20. Plug that into your for loop instead of the Sides_of_Dice and that'll give you 20 loops.
2. The following line does not count how many times the die landed on each side:
cout<< i + 1<<" was rolled "<<counter<<" times"<<endl;
What you need to do is create say 6 variables, 1 for each die to count how many times it has been rolled:
1 2
|
int count1 = 0;
int count2 = 0;
|
etc...
After each random number is generated, check if counter == the specific number and then increment the count of that number. So for example say the die rolls a 2. You may want to say:
1 2
|
if ( counter == 1 )
count1++;
|
Once your for loop ends (die is rolled 20 times), you can then display how many times each number was rolled:
|
cout << "1 was rolled " << count1 << " times." << endl;
|
Hope this helps.
Return 0;
EDIT: Also, you might as well toss those constant variables out and just use 20 and 6. I think what you originally planned to do was use the Sides_of_Dice to create the limits for your random number generation. Both are unnecessary for this program.