Dice Roll, I could not find the problem, ?'m waiting for your helps

 Ahmet Semi Asarkaya · September 7, 2015 #include #include #include  #include #include #include int main(){ srand(time(NULL)); char  guess,s,l,h; int sum[1111],sum1[1111],i; printf("\tGUSS THE NEXT ONE\n"); printf("Guess whether the next roll is going to be higher, lower or stay the same"); printf("Higher ---> h\n"); printf("Lower  ---> l\n"); printf("Same   ---> s\n\n\n"); for(i=0; i<1111; i++) { sum=3+rand()%15;            printf("Dices rolls' sum is %d\n\n",sum);            sum1=3+rand()%15;        printf("Guess about the next dices rolls\n\n\t:"); scanf("%c",&guess); if(guess=='s' && sum==sum1) {       printf("\n\nThe Next Dices rolls' sum is %d\n\n",sum1); printf("\n\nCongralations!!! You Won the game!!!\n\n\n\n\n\n"); } else if(guess=='h' && sumsum1) { printf("\n\nThe Next Dices rolls' sum is %d\n\n",sum1); printf("\n\nCongralations!!! You Won the game!!!\n\n\n\n\n\n"); }     else    {    printf("\n\nThe Next Dices rolls' sum is %d\n\n",sum1);    printf("\n\nWrong Answer .....\nYou Lost\n\n\n\n\n\n"); } }     return 0;}

Replies

 Jon Z. · September 8, 2015 Please in the future specify what's the problem (doesn't compile, gives wring output, etc).you are using sum arrays, they should be just variables, or at least specify which element of the array you are using (sum).also chars s, l and h are unnecessary.
• 1

C

129,726 followers