title: while() loop to ask for positive input
body: <p>I am writing a function that ask the user for input and then checks if that input is infact a positive number if not it loops until a positive number is inputed and then returns that values. This is what i have so far but when it returns im getting a weird number like 20204421.000 any help?</p>
  
  <pre><code>/* Checks if rate is infact positive and loops until a positive number is inputed */
  int checkposrate(int rentrate) 
  {
      while (rentrate &lt; 0){
          printf("Please enter the anual rental rate per square foot(must be positive number):");
          scanf("%f",&amp;rentrate);
      }
      return rentrate;
   }
  </code></pre>