234k views
3 votes
What an algorithm to calculate area of squre.​

User Fryer
by
4.6k points

2 Answers

4 votes
The formula for calculating the surface area of a square is A = L x W
Area = Length x Width

The formula for Perimeter is P = 2L + 2W
Which simply means add all the sides
(Perimeter = 2 Length + 2 Width

These formulas only work for 2d shapes not 3d.

To calculate Volume of a cube its
V= L x W x H
Volume= Length x Width x Height

Hope this helps
User Pawan Singh
by
4.3k points
5 votes

algorithm to calculate area of the square

input x.

sq=x*x.

print sq.

User Robbymurphy
by
4.7k points