:::: MENU ::::
  • Suitable for all screen sizes

  • Easy to Customize

  • Customizable fonts.

Wednesday, December 16, 2015


Area of Triangle:

import java.util.Scanner;
class AreaTriangle {
   public static void main() {  
      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();
      double area = (base* height)/2;
      System.out.println("Area of Triangle is: " + area);    
   }
}

Thank you and make sure to like and comment.

0 comments:

Post a Comment

A call-to-action text Contact us