This is a Java program that calculates the area of a triangle given its base width and height.
import java.util.*; public class Area_Triangle { public static void main(String []args) { double base,height,area; Scanner input = new Scanner(System.in); System.out.print("Enter the Base Width : "); base = input.nextDouble(); System.out.print("Enter the Height : "); height = input.nextDouble(); area = (base*height)/2;// Area of Triangle System.out.println("Area of Triangle: " + area); } }
Enter the Base Width : 25.12 Enter the Height : 56.51 Area of Triangle: 709.7656
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions