Write a Java program to find the area of square and triangle. - Pratik Ghelani

Pratik Ghelani

Breaking

Monday, January 21, 2019

Write a Java program to find the area of square and triangle.

Program:-

public class p2 {
public static void main(String[] args) {
double a=50;
double b;
b=a*a;
System.out.println("Area of Square :- "+b);
double t=5;
double g;
g=a*t/2;
System.out.println("Area of Triangle :- "+g);
}
}

Output:-


No comments:

Post a Comment