Computer Science, asked by kray20447, 3 months ago

write a java program to take input of three sides of a triangle using standard input dialogue box compute the area of the triangle show the output using message dialogue box. Show the output using message dialogue box.​ (using JOptionPane)

Answers

Answered by mithulpranav24826
0

I am very sorry because I do not know the exact answer for your question.

I hope you find the following answer helpful.

Answer:

import java.io.*;

public class areatriangle

{

   public static void main(String[] args) throws IOException

   {

       InputStreamReader isr=new InputStreamReader(System.in);

       BufferedReader br=new BufferedReader(isr);

       System.out.println("Enter the First Side");

       int a=Integer.parseInt(br.readLine());

       System.out.println("Enter the Second Side");

       int b=Integer.parseInt(br.readLine());

       System.out.println("Enter the Third Side");

       int c=Integer.parseInt(br.readLine());

       int s=(a+b+c)/2;

       int a1=(s*(s-a)*(s-b)*(s-c));

       double area=Math.sqrt(a1);

       System.out.println("The area of the triangle is = "+area);

   }

}

Answered by M.Mithul Pranav.

Hope it helps.

Similar questions