Computer Science, asked by rakhimondal198226, 15 hours ago

write a program in C to calculates area and perimeter of square

Answers

Answered by indialover44
0

Answer:

MAR me the brainliest plz

Explanation:

Declare any two variables of floating-point type. Because side length of square may contain decimal value

Receive length of square in len variable

Perform multiplication operation of given value to len variable with itself and initialize it to area variable

Now just print the value of area as output

The variable area indicates area of square on output screen

to find perimeter of square, use the formula perimeter = 4*side. Here side indicates side length of square. To calculate perimeter, we have to find the boundary length of square. As square has 4 side of equal length, so here we only have to ask for side length, and then just multiply it with 4. That will be perimeter.

Similar questions