#include #include #include int main() { // generating many useful ranges of random number // seed the random generator with current time srand((unsigned)time(NULL)); // two dice int die1 = rand()%6 +1; int die2 = rand()%6 +1; printf(" The dice roll is: %d %d \n", die1, die2); int percent = rand() %101; printf(" percent rolled is %d \n", percent); if (percent < 20) printf (" Simulating probabilities: This print is done with 20 percent of the time \n"); int flipCoin = rand() %2; if (flipCoin == 1) printf (" heads \n"); else printf (" tails \n"); return 0; }