title: Input validation ( with multiple values )
body: <p>For school, I wrote a program to calculate the voltage and current of an bridge circuit with bridge resistance.</p>
  
  <p>My problem is that I want the user to enter all resistances as a CSV (R1, R2, R3...). I want to validate the user input to check if only floats or integers are entered.</p>
  
  <p>I wrote this do-while loop for the validation, to force the user to re-enter the values if the input isn't valid:</p>
  
  <pre><code>int check = 1;
  do{
    if(check == 0){                                                           
      check = 1;
      puts("Re-Enter as the following: R1, R2, R3, R4, Rab");
    }//endif
    check = scanf("%f, %f, %f, %f, %f", &amp;fR1, &amp;fR2, &amp;fR3, &amp;fR4, &amp;fRab);           
    fflush(stdin);
  }while(check == 0);
  check = 1;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This code just "throws" an "error" if the user enters letters or the wrong count of arguments (for example: 12, 12, [ENTER]). What is the best way to validate the user-input?</p>