Write an algorithm to find the sum of a square of two numbers m and n
Answers
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]
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 : Start
Step : Read m , n.
Step : Let ctr =, sum =
Step : Read Num.
Step :
Step : Compute the square of the number i.e., =
Step :
Step : If ctr is less than Num then repeat steps 3 to 6.
Step : Print sum.
Step : End.
#SPJ2