Write a program to play a dice game against the computer. The game is very simpl
ID: 3543506 • Letter: W
Question
Write a program to play a dice game against the computer. The game is very simple. You will place a
wager of tokens. The computer rolls a dice and you roll a dice. If your dice is greater in value than the
computer's dice you win your wager. If the computer's dice is greater in value than yours, the
computer wins. Nobody wins in a tie. Programing in C
To generate random numbers:
a) Include stdlib.h and time.h in your preprocessor directives
b) In the main body of the program, after all variables have been initialized use the srand()
function to seed your random number generator rand().
c) srand(time(NULL));
d) more_statements;
e) Dice = (rand() % 6) + 1; /* random number 1 to 6 */
Explanation / Answer
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.