Area of a Triangle in JAVA programming


package SolveProblem;

import java.util.Scanner;

public class AreaOfATrianglr {

    public static void main(String[] args) {
        Scanner myScanner=new Scanner(System.in);
        int area,len,wid;
        System.out.println("Enter the value of Length of a Triangle : ");
        len=myScanner.nextInt();
       
        System.out.println("Enter the value of Width of a Triangle : ");
        wid=myScanner.nextInt();
       
        area=len*wid;
       
        System.out.println("Area of the Triangle is : "+area);
    }

}
//Enter the value of Length of a Triangle :
//3
//Enter the value of Width of a Triangle :
//3
//Area of the Triangle is : 9

No comments:

Post a Comment