Computer Science, asked by sneha37376746, 6 months ago

3. Write a python program to calculate Area of rectangle and circle an
print the results. Take input from user (length, breadth and radius)

Answers

Answered by ygeetu908
6

Explanation:

3. Write a python program to calculate Area of rectangle and circle an

print the results. Take input from user (length, breadth and radius)

Answered by atrs7391
2

def square():

  s = float(input("Enter the side of the square: "))

  print("Area of square =", s * s)

def rectangle():

  le = float(input("Enter the length of the rectangle: "))

  b = float(input("Enter the breadth of the rectangle: "))

  print("Area of the rectangle =", le * b)

def circle():

  r = float(input("Enter the radius of the circle: "))

  print("Area of the circle =", 3.14 * (r * r))

print("Press 1 to calculate Area of Square")

print("Press 2 to calculate Area of Rectangle")

print("Press 3 to calculate Area of Circle")

f = int(input())

if f == 1:

  square()

elif f == 2:

  rectangle()

elif f == 3:

  circle()

else:

  print("Error 404: Wrong number pressed, cannot calculate area!")

Similar questions