Write a program to find area of triangle using Heron's formula in java

 Write a program to find area of triangle using Heron's formula in java


public class AreaOfTriangle
{
    public static void main(String args[]){
    double side1=12 , side2=10 , side3=12 , s , area;
    s=(side1+side2+side3)/2;
    area=Math.sqrt(s*(s-side1)*(s-side2)*(s-side3));
    System.out.println("Area  of triangle is : "+area);
   }
}

Output

Area  of triangle is : 54.543560573178574

Comments

Popular posts from this blog

Make a GST Calculator using HTML and JavaScript

How to make simple bill maker by using python tkinter

Write a program to find the sum of 1/2+4/3+5/6+8/7+9/10 using loop in java