16 lines
340 B
C
16 lines
340 B
C
|
#include <stdio.h> // printf
|
||
|
#include <stdlib.h> // rand and srand
|
||
|
#include <time.h> // time
|
||
|
|
||
|
//TODO: Write the dice function here
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
srand(time(0)); // you only have to set up your seed once
|
||
|
|
||
|
int Number = (rand()%6)+1;
|
||
|
|
||
|
// call the dice function and don't forget to add them together
|
||
|
printf("You rolled a %d",Number);
|
||
|
}
|