title: Java program using the formula of triangle Area= 1/2*base*height as is
body: <p>Does anyone knows how to compute for the <strong>Area of a triangle</strong> using this formula in traditional java without changing or adding anything in the formula?</p>
  
  <p><strong>Area = 1/2*base*height</strong></p>
  
  <p>If i alter the formula like:</p>
  
  <p>Area = 
  1.0f/2*base<em>heigh  or  1/2.0f</em>base*height    or  0.5*base*height        </p>
  
  <p>...this will definitely give me what I am looking for.</p>
  
  <p>But what I am trying to do is using the formula <strong>Area=1/2*base*height</strong> as is. Someone told me their is a way but I can't seem to follow. 
  If this is my program:</p>
  
  <p>public class  Area {</p>
  
  <pre><code>public static void main (String[] args) {
  
           // If this is the given value
           int base = 5;
           int height = 5;
           float Area = 0;
  
           //Using this formula without altering or adding anything on it
           Area = 1/2*base*height;
  
  
           System.out.println("Area = " +Area);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This will give out:</p>
  
  <p>Area = 0.0</p>
  
  <p>*How will I get:</p>
  
  <p>Area = 12.5</p>