title: how to get program to accept only positive integer values in c
body: <p>writing a program that will be finding min, max, avg of values entered by user. Having trouble writing something that will check to make sure there are only postive integers entered and produce an error message. heres my for statement that is reading the input so far:</p>
  
  <pre><code>  for (int value = 0; value &lt;= numofvals; ++value) {
        printf("Value %d: %f\n", value, val_input);
        scanf("%f", &amp;val_input);
    }
  </code></pre>
  
  <p>mind you I've been learning code for about 3 weeks and was just introduced to loops this week so my understanding is rudimentary at best!</p>