Computer Science, asked by Sumerajj, 8 months ago

Write an algorithm to find the sum of a square of two numbers m and n

Answers

Answered by baski3d
10

Answer:

Yes! Here is your answer!

Explanation:

Algorithm for accept a number from user and calculate sum of square:

[Sum of square procedure:accept number num from user, and set sum=0 and calculate sum of square.]

Step 1. Start

Step 2. Read number num

Step 3. [Initialise]

       sum=0, i=1

Step 4. Repeat step 4 through 6 until i<=num

Step 5. sum=sum+(i*i)

Step 6. i=i+1

Step 7. print the sum of square

Step 8. stop

[end of loop step 4]

[end of sum of square procedure]

Answered by ashutoshmishra3065
1

Answer:

Explanation:

Algorithm definition:

An algorithm is a process used to carry out a computation or solve a problem. In either hardware-based or software-based routines, algorithms function as a detailed sequence of instructions that carry out predetermined operations sequentially. All aspects of information technology employ algorithms extensively.

Algorithm to find the sum of a square of two numbers m and n

Step 1: Start

Step 2: Read m , n.

Step 3 : Let ctr =0, sum = 0.

Step 4: Read Num.

Step 5 : ctr = ctr + 1.

Step 6: Compute the square of the number i.e., = sqr (Num \times Num).

Step 7 : sum = sum \times sqr.

Step 8: If ctr is less than Num then repeat steps 3 to 6.

Step 9: Print sum.

Step 10: End.

#SPJ2

Similar questions