title: Stopping an infinite while loop using scanf in c?
body: <p>I created a program that accepts 3 numbers separated by comments which I will use to do some calculations. It will accept user input for these numbers and I'm using scanf to accept that.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;ctype.h&gt;
  #include &lt;stdbool.h&gt;
  
  int main(void)
  {
      float a, b, c;
  
      bool continue_program = true;
  
      while (continue_program) {
          printf("Enter your coordinates: ");
          scanf("%f,%f,%f", &amp;a,&amp;b,&amp;c);
          if(isdigit(a) &amp;&amp; isdigit(b) &amp;&amp; isdigit(c)){
              printf("Success!");
          } else {
              printf("Try again!");
          }
      }
  }
  </code></pre>
  
  <p>Example Output:</p>
  
  <pre><code>Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!Enter your coordinates: Try again!
  </code></pre>
  
  <p>I know that other people have also faced the same issue and went through the answer for those ones but couldn't get their implementations working for this code.</p>