Answers for "area of an equilateral triangle"

1

area of equilateral triangle in java

import java.util.Scanner;
public class AreaOfEquilateral
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      System.out.println("Please enter the side of equilateral triangle: ");
      double side = sc.nextDouble();
      double area = (Math.sqrt(3)/4) * (side * side);
      System.out.println("Area of equilateral triangle is: " + area);
      sc.close();
   }
}
Posted by: Guest on October-30-2020
12

how to find the area of a triangle

#this is the code to find the area of a parrelogram and triangle
#change the numbers to select what height and base your shape is

b = 3 #b is base 
h = 3 #h is height (middle)


t = 5 #this is the base of the triangle
i = 5 #and this is the height
p = t*i #dont touch this


print("this is the area of the parrelogram")
print(b * h)

m = input("do you want to calculate a triangle? (space before answer)") 

print(m)

if m == " yes":
    print ("this is the area of the triangle that you inputed")
    print (p/2)
else:
    print("ok")
Posted by: Guest on April-30-2020

Code answers related to "area of an equilateral triangle"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language