I'm trying to write this simple two dice game to get better at programming but a keep getting 'segmentation fault'
this is the code:
#include <stdio.h>
main ()
{
srand (time());
int Die1= (rand() % 6) + 1;
int Die2= (rand() % 6) + 1;
int sum;
printf ("\nThe dices roll\n");
printf ("Dice one and two are: %d,\t%d",Die1,Die2);
sum= (Die1 + Die2);
printf ("\n%d",sum);
if ((sum == 7) || (sum == 11))
printf ("\nYOu guess right");
else
printf ("\nYou guess wrong");
return (0);
}
can anyone tell what is wrong ??
thanx