#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// Returns a random number from 1 to 6
int rollDice(void) {
return (rand() % 6) + 1;
}
int main(void) {
// Seed once
srand((unsigned int)time(NULL));
int dice1 = rollDice();
int dice2 = rollDice();
printf("Dice 1: %d\n", dice1);
printf("Dice 2: %d\n", dice2);
return 0;
}
/*
run:
Dice 1: 4
Dice 2: 2
*/