A Program to Find the Area of a Square

In this example, we are giving a program to find the area of a square. The rule of finding the area of a square is: A = length * length.


Program to find the area of a square:

  1. l = float(input("Enter the value of length: "))
  2. area = l * l;
  3. print("Area of square: %.2f"%area)

Output:

Enter the value of length: 3
Area of square: 9.00