title: Determining if a float has a fractional part?
body: <p>Here is the problem: The game Totals can be played by any number of people. It starts with a total of 100 and each player in turn makes an integer displacement between -20 and 20 to that total. The winner is the player whose adjustment makes the total equal to 5. Using only the three variables given:
  total 
  adjustment 
  counter
  Here is what I have so far: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main (void)
  {
      int counter=0;
      float adj;
      int ttl=100;
  
      printf("You all know the rules now lets begin!!!\n\n\nWe start with 100. What is\n");
  
      while (ttl!=5)
      {
          printf("YOUR ADJUSTMENT?");
          scanf("%f",&amp;adj);
          counter++;
          if (adj&lt;=20 &amp;&amp; adj&gt;=-20)
          {
          ttl=ttl+adj;
          printf("The total is %d\n",ttl);
          }
          else
          {
          printf ("I'm sorry. Do you not know the rules?\n");
          }
      }
      printf("The game is won in %d steps!",counter);
  
  }
  </code></pre>
  
  <p>What I need:
  When a decimal number is entered it goes to the else. How do I determine if a float has a fractional part.</p>