Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main {
- public static void main(String args[]) {
- Scanner scanner = new Scanner(System.in);
- System.out.println("Enter the width: ");
- double base = scanner.nextDouble();
- System.out.println("Enter the height: ");
- double height = scanner.nextDouble();
- //Area = (width*height)/2
- double area = (base* height)/2;
- System.out.println("Area of Triangle is: " + area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement