//program to implement dies game #include #include int main() { int p1[2],p2[2]; // both arrays stores values of dies rolled by player1 and 2 respectively printf("rolling the die for player1\n"); p1[0]=1+rand()%6; p1[1]=1+rand()%6; printf("rolling the die for player2\n"); do { p2[0]=1+rand()%6; p2[1]=1+rand()%6; }while(p1[0]==p2[0] && p1[1]==p2[1]); printf("player1 values %d \t %d \n",p1[0],p1[1]); printf("player2 values %d \t %d \n",p2[0],p2[1]); //print result if(p1[0]==p1[1] && p2[0]!=p2[1]) printf("player1 won\n"); else if(p1[0]!=p1[1] && p2[0]==p2[1]) printf("player2 won\n"); else if(p1[0]==p1[1] && p2[0]==p2[1]) { if(p1[0]>p2[0]) printf("player1 won\n"); else printf("plyer2 won\n"); } else if(p1[0]+p1[1]>p2[0]+p2[1]) printf("player1 won\n"); else if(p1[0]+p1[1]