# Challenge/Assignment given by Bucky on the 38th episode (random number generation) of C

 Dona Paul · October 4, 2015 Guyz i cant get what Bucky said. The program generates 3 random numbers for rolling of a dice, and calculate the sum. Upto that its fine.  Now the user have to guess that the next roll is gonna be higher, lower, or same.... than what ? the sum?or than the last(3rd) roll ?

## Replies

 Dona Paul · October 13, 2015 yeah thanx abhijeet Sharma · October 6, 2015 #include #include #include#include#include#includeint main(){    int dicenumber;    int n,sum,sum1;    int a[4];    char ans;srand(time(NULL));         printf("\nthe numbers are :");    for(n=0;n;n++){            dicenumber = rand()%6+1;            printf("\n %d",dicenumber);            a[n]=dicenumber;            }            sum = a[0]+a[1]+a[2];            printf("\nthe sum of dicenumber is: %d\n",sum);            printf("what is your choice  i.e the sum would be greater then this %d?(y/n)\n)",sum);            scanf(" %c",&ans);                 srand(time(NULL));                for(n=0;n;n++)                    {                    dicenumber = rand()%6+1;                    a[n]=dicenumber;                    }                 sum1 = a[0]+a[1]+a[2];                 if ((sum1>sum&&ans=='y')||(sum1
• 1

## C

129,668 followers