Computer Science, asked by debarghyabaidya2020, 5 months ago

write a java program to calculate the perimeter of an equilateral triangle takin side 4.5 and perimeter 3 × side​

Answers

Answered by hasikakama9
1

Answer:

Perimter=sum of all lengths of sides of triangle

⇒ Perimeter =3a {a= side of triangle }

⇒45=3a

⇒a=15cm.

Answered by anindyaadhikari13
1

Question:-

➡ Write a java program to calculate the perimeter of an equilateral triangle takin side 4.5 and perimeter 3 × side.

Program:-

This is written in Java.

class Program

{

public static void main(String args[])

{

double s, p;

s=4.5;

p=3*s;

System.out.println("Perimeter of the triangle is: "+p);

}

}

Variable Description:-

  1. s - Used for storing the length of each side of triangle.
  2. p - For calculating the perimeter of the Triangle (p=3s)
Similar questions