title: How do i prevent my code from accepting decimals, and only whole numbers
body: <p>So i'm trying to do a check if the user inputs a decimal value the code would print out invalid value and ask for another value. any ideas?
  really new to c-code any guide or tips would be loved.
  i'm guessing its something to do with "value" *2, if the value is an even number true, else false.
  if i'm right or wrong please tell me so, the issue is i don't know how to put it in code    </p>
  
  <pre><code>     do
          {
          printf("\nEnter value for 1st side of the Triangle: ");
          fflush(stdin);
          scanf("%d%*c", &amp;side1);
  
          if((side1 &lt;= 0) || (side1 &gt; 999))
          {
              printf ("Invalid Value, Retry Input\n");
              fflush(stdin);
          }
          if ((side1 &gt;= 1) &amp;&amp; (side1 &lt; 999))
          {
              printf("Enter value for 2nd side of the Triangle: ");
              fflush(stdin);
              scanf("%d%*c", &amp;side2); 
          }   
  
          if ((side2 &lt; 0) || (side2 &gt; 999))
          {
              printf ("Invalid Value, Retry Input\n");
              fflush(stdin);
          }
          if ((side2 &gt;= 1) &amp;&amp; (side2 &lt; 999))
          {
              printf("Enter value for 3rd side of the Triangle: ");
              fflush(stdin);
              scanf("%d%*c", &amp;side3);
          }
  
          if ((side3 &lt; 0) || (side3 &gt; 999))
          {
              printf ("Invalid Value, Retry Input\n");
              fflush(stdin);
          }
          if ((side3 &gt;= 1) &amp;&amp; (side3 &lt; 999))
          { 
              success = 1;
          }   
          }
          while(success == 0);
  </code></pre>