document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6.  
  7. int main()
  8. {
  9.     int i;
  10.     int diceRoll1 = 0;
  11.     char guess;
  12.  
  13.     srand(time(NULL));
  14.  
  15.     for(i=0; i<3; i++)
  16.     {
  17.         diceRoll1 += ( rand()%6 ) + 1;
  18.     }
  19.     printf("The sum of the dice roll is %d\\n", diceRoll1);
  20.  
  21.     printf("Guess the next sum(press :h or l or e)\\n");
  22.     scanf("%s", &guess);
  23.  
  24.     int diceRoll2 = 0;
  25.     for(i=0; i<3; i++)
  26.     {
  27.         diceRoll2 += ( rand()%6 ) + 1;
  28.     }
  29.     printf("The sum of the dice roll is %d\\n", diceRoll2);
  30.  
  31.     if(diceRoll1 == diceRoll2 && guess == \'e\')
  32.         printf("Great Job!!");
  33.     else if(diceRoll1 < diceRoll2 && guess == \'h\')
  34.         printf("Great Job!!");
  35.     else if(diceRoll1 > diceRoll2 && guess == \'l\')
  36.         printf("Great Job!!");
  37.     else
  38.         printf("You Suck!!");
  39.  
  40.  
  41.     return 0;
  42.  
  43. }
');