Computer Science, asked by mounibeauty30091, 9 days ago

Take input of choice from the user. If choice is 1 the calculate area of rectangle, if choice is 2 then calculate and print perimeter of rectangle else print wrong choice.

Answers

Answered by tsnikhilraj2009
0

Answer:

This answer is considering you are using python and you will ask for input values for length and breadth of rectangle

Explanation:

l=input("Enter length for rectangle: ")

b=input("Enter breadth for rectangle: ")

a= input("Enter a number- 1 or 2: ")

if (a==1):

  print (l*b)

elif (a==2):

  c=l+b

  print (2*c)

else:

  print ("Wrong choice")

Similar questions