Computer Science, asked by amberdanka, 8 months ago

ALGORITHM TO FIND AREA OF A SQUARE

Answers

Answered by sumit1202
0

Answer:

an algorithm is a well defined procedure or formula to solving the problem related to sequence of specified action

so write the process step by step

Answered by manas12374
1

There are two ways you can do this:

Have a function that takes one parameter (the length of a side of a square—call it s ), and returns s∗s .

Recognize that a square is just a special case of a rectangle and have two functions:

A rectangle function that takes two arguments (call them width and height ) and returns width∗height

A square function that takes a parameter s , and calls your rectangle function with s as both width and heigh.

Please Mark me as a Brainliest Answerer ☺️☺️

Similar questions