Write a program using C++ to simulate a pair of dice. Run yoursimulation 1000 times and record the data for the followingevents:
A: Sum of the outcome is even
B: Sum of the two dice is at least 10
C: The first die comes up 5
ii. Compute the probability of each event using yourprogram.
Solution
#include<iostream>
#include<cstdlib>
using namespacestd;
int main()
{
// Sum of the outcome is even
int even_sum =0;
// Sum of the two dice is at least 10
int sum_atleast_10 =0;
// The first die comes up 5
int first_die_5 =0;
int i;
for( i= 1 ; i <=1000 ; i++ )
{
OR
OR