title: Error: expected declaration specifiers or '...' before string constant [puts() and gets() statement errors
body: <p>After compiling my program of Dice Roll, I got this error. What is wrong with the code?</p>
  
  <p>Also before I was using gets() instead of scanf() command, but because of that I got this error - <em>passing argument 1 of 'gets' makes pointer from integer without a cast</em>
  So I removed the gets() command and used scanf and then there was no error regarding scanf(). </p>
  
  <p><strong>What is the reason for getting these two errors?</strong></p>
  
  <hr>
  
  <p>Ok, so as per the answer I got to know how I should have used the gets() command and why I shouldn't use it instead should use scanf(). So, I made the changes. 
  Though I have encountered two new errors, this time it's related to the delay() command that I used. </p>
  
  <p>Errors: undefined reference to delay
          |error: ld returned 1 exit status|</p>
  
  <hr>
  
  <p>OK so I solved my last errors by using Sleep() command from windows.h library instead of Delay() command. The programs was compiled. 
  But still there is a runtime error in the program, it works well till getting the roll1 but then it just print the next two statement and terminated the programs without taking a input for the guess. </p>
  
  <p>It skips all the code after <code>printf("Will it be Higher/Lower or the same? (press H/L/S)\n");</code> and directly terminates the program.</p>
  
  <hr>
  
  <p>Ok So I solved above problem adding a whitespace before the <code>"%c"</code> in  <code>scanf(" %c", &amp;nextGuess);</code> statement. (Little things xD)
  Now only problem is that my <code>toupper()</code> command is not working.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  #include &lt;windows.h&gt;
  
  
  int main()
  {
      int i, roll1=0, roll2=0, NumberOfRolls, RandomNUM1[50], RandomNUM2[50];
      char nextGuess;
  
      puts("Welcome to the Dice Roll Game");
      puts("How many times do you want to roll a dice?");
      scanf("%d", &amp;NumberOfRolls);
  
      for( i=1; i&lt;=NumberOfRolls; i++ ) {
          RandomNUM1[i] = ( rand()%6 ) + 1;
          roll1 += RandomNUM1[i];
      }
  
      printf("\nYou Got %d in your first roll!\n", roll1);
      Sleep(3000);
      printf("\nLet's see if you can guess the value of next roll.\n");
      printf("Will it be Higher/Lower or the same? (press H/L/S)\n");
      scanf(" %c", &amp;nextGuess);
      toupper(nextGuess);
  
          for( i=1; i&lt;=NumberOfRolls; i++ ) {
          RandomNUM2[i] = ( rand()%6 ) + 1;
          roll2 += RandomNUM2[i];
      }
  
      if(nextGuess=='H'){
          if(roll1&lt;roll2){
              printf("You are such a player, you guessed it right! It's %d", roll2);
          }
          else if(roll1&gt;roll2){
              printf("Uh-Oh! Bad Luck! First roll was higher, It's %d", roll2);
          }
          else if(roll1==roll2){
              printf("Uh-Oh! Bad Luck! Both the rolls are same, It's %d", roll2);
          }
  
      }
  
      if(nextGuess=='L'){
          if(roll1&gt;roll2){
              printf("You are such a player, you guessed it right! It's %d", roll2);
          }
          else if(roll1&lt;roll2){
              printf("Uh-Oh! Bad Luck! First roll was lower, It's %d", roll2);
          }
          else if(roll1==roll2){
              printf("Uh-Oh! Bad Luck! Both the rolls are same, It's %d", roll2);
          }
  
      }
  
      if(nextGuess=='S'){
          if(roll1==roll2){
              printf("You are such a player, you guessed it right! It's %d", roll2);
          }
          else if(roll1&gt;roll2){
              printf("Uh-Oh! Bad Luck! First roll was higher, It's %d", roll2);
          }
          else if(roll1&lt;roll2){
              printf("Uh-Oh! Bad Luck! Second roll is higher, It's %d", roll2);
          }
  
      }
  
          return 0;
  }
  </code></pre>