A Program to Find the Area of a Rectangle
In this example, we are giving a program to find the area of a rectangle. The rule of finding the area of a rectangle is: A = width * height.
Program to find the area of a rectangle:
w = float(input("Enter the value of width: "))
h = float(input("Enter the value of height: "))
area = w * h;
print("Area of rectangle: %.2f"%area)
Output:
Enter the value of width: 3 Enter the value of height: 4 Area of rectangle: 12.00