Craps is a popular dice game played in casinos Write a progr
Solution
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
int d1, d2 = 0;
int rd;
char rep = \'y\';
while (rep == \'y\' || rep == \'Y\')
{
d1 = rand() % 6 + 1;
d2 = rand() % 6 + 1;
rd = d1 + d2;
cout << \"Your rolled \" << rd;
if (rd == 7 || rd == 11)
{
cout << \"!!!!! Winner !!!!!\" << endl ;
}
else if (rd == 2 || rd == 3 || rd == 12)
{
cout << \" !!!!!You lose!!!!!\" << endl;
}
else if (rd == 4 || rd == 5 ||rd == 6 ||rd == 8 || rd == 9 || rd == 10)
{
d1 = rand() % 6 + 1;
d2 = rand() % 6 + 1;
int s2 = d1 + d2;
if( s2 == rd )
{
cout << \". Winner !\" << endl;
break;
}
else if( s2 == 7 )
{
cout << \". You Lose!\" << endl;
break;
}
}
cout <<\"Another game? Y(es) or N(o)\" << endl;
cin >> rep;
while (rep == \'n\' || rep == \'N\')
{
cout << \"Thank you for playing!\"<< endl;
}
return 0;
}
}

