InterviewSolution
Saved Bookmarks
| 1. |
Write an algorithm to compute sum of the square of N numbers. |
|
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. |
|