Q. Area of an equilateral triangle can be computed as √3/4 * a2 where a is its side. Write a program to obtain side from user and print the area of equilateral triangle with side a.


Answer :-


import math
side = float(input("Enter the side of Triangle :- "))
area = math.sqrt ( 3 ) / 4 * side ** 2
print ("Area of Triangle :-",area)


Output :-

Enter the side of Triangle :- 2
Area of Triangle :- 1.7320508075688772

>>> 

Enter the side of Triangle :- 100
Area of Triangle :- 4330.127018922193

>>>

2 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. But area √3/4 ki form me nhii aayega aise 3/4 ki form me aayega

    ReplyDelete
    Replies
    1. math.sqrt ( 3 ) will execute before / 4 side **2.
      So, Try this code in your python.

      Delete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post