Write a program to Java to accept or assign perpendicular and base of right angle triangle calculate the display the area of triangle area of triangle =half * perpendicular *base using scanner class
Answers
Answered by
0
Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int perpendicular=sc.nextInt();
int base=sc.nextInt();
int area=(perpendicular*base)/2;
System.out.println("Area of triangle= "+area);
}
}
Explanation:
Similar questions