Area and Perimeter of Square
- Area of square is side*side
- Perimeter of a square is 4*side or (side + side + side + side)
Steps :
- Read one side of a square.
- we know that in square all sides are equal.
- substitute the side value in above formulae to obtain area and perimeter.
Input :
enter a side 4
Output :
Area is 16
Perimeter is 16
Program to find area and perimeter of a square in python.
#program to print area and perimeter of a square.
side=int(input("enter a side "))
#area of square side*side
area = side*side
print("Area is ",area)
#perimeter of a square.
perimeter = 4*side
print("Perimeter is ",perimeter)
Output :
enter a side 4
Area is 16
Perimeter is 16
Comments
Post a Comment
Type Your Comments !
Please do not enter any spam link in the comment box.