+3 votes
in Class 11 by kratos

Write an algorithm to compute sum of the square of N numbers.

1 Answer

+4 votes
by kratos
 
Best answer

The algorithm as :

Step 1: Read N.

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

Step 3: Read Num.

Step 4 : ctr = ctr + 1.

Step 5: Compute the square of the number i.e., = sqr (Num * Num).

Step 6 : sum = sum * sqr.

Step 7: If ctr is less than N then repeat steps 3 to 6.

Step 8: Print sum.

Step 9: End.

...