title: How to check if user enters blank line in scanf in c
body: <p>I need the program to exit the while loop if the user presses enter without entering any float value. Thanks!</p>
  
  <pre><code>printf("Enter scores\n”);
  
  float scores[10];
  int n=0;    
  
  while (n&lt;10){
  
      scanf("%f", &amp;scores[n]);
      n++;
      if (THE USER PRESSES ENTER WITHOUT ENTERING ANYTHING){break;}
  
  }
  </code></pre>