Computer Science, asked by adfrt, 1 year ago

Write a program to enter the height and base of a triangle and by \\using pythagorean triplate calculate its area

Answers

Answered by Anonymous
7

import java.util.*;

public class Area

{

public static void main(String args[])

{

Scanner in= new Scanner(System.in);

int x,z,a;

System.out.println("Enter the height of the triangle");

x=in.nextInt();

System.out.println("Enter the base of the triangle");

z=in.nextInt();

a= (1/2)*x*z;

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

}

}

Similar questions