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

Calculate Compound Interest in JavaScript

How to make simple bill maker by using python tkinter

Admin Login Page Using HTML and CSS