1 ) WAP to calculate the area of -
a) rectangle by entering length and width.
b) triangle by entering hieght and base.
*these are for python
Answers
Answered by
0
Answer:
print("Area calculator /n 1.Rectangle /n 2.Triangle")
opt = int(input("Enter option"))
if(opt ==1):
l = input("Enter length")
b= input("Enter breadth")
A = l * b
print("Area is ",A)
else :
h = input ("Enter height")
b = input ("Enter breadth")
A = 0.5 * h * b
print("The area is",A)
Answered by
1
Question:-
WAP to calculate the area of:-
- Rectangle by entering length and breadth.
- Triangle by entering the height and base.
Program:-
This is written in Python.
print("1. Rectangle Area. \n2.Triangle Area. ")
ch=int(input("Enter Choice: "))
if ch==1:
a=int(input("Enter length: "))
b=int(input("Enter breadth: "))
print("Area is: ",a*b)
elif ch==2:
h=int(input("Enter height: "))
b=int(input("Enter base: "))
c=0.5*h*b
print("Area is: ",c)
else:
print("Wrong input. ")
Similar questions
Environmental Sciences,
4 months ago
Social Sciences,
4 months ago
English,
4 months ago
English,
9 months ago
Math,
9 months ago
India Languages,
1 year ago
Economy,
1 year ago
History,
1 year ago