Area of the square is the amount of space occupied by a square. Square refers to a plane figure with four equal straight sides and four right angles.
Formula
area = width × height
Area of square will be calculated as :
area = side2
since width = height;
Algorithm
- Define the height of any one side of the square as 's.'
- Calculate the area of the square by multiplying s with s
- Define the area_square as the area of the square.
Complexity
O(1)
Input:
a = 13
Output:
Area of Square = a2
= 132
= 169
C Program
Output:
PHP Program
Output:
Java Program
Output:
C# Program
Output:
Python Program
Output: