453,366 views
11 votes
11 votes
How to write the algorithm to calculate the square of five numbers

User Harkirat Saluja
by
2.9k points

1 Answer

5 votes
5 votes

Answer:

1. A = 7 and B = 12 here...

2. A^2 = 49 thus final answer will have 9 at units place and 4 is carried to add later.

3. Given number multiplied by 'B' => 127*12 = 1524

4. A*B => 12*7 = 84

5. 1524+84 = 1608 ..... ( step 3 + step 4 )

6. 1608+4 =1612 .... (4 is carried as stated in step 2)

7. Now, 16129 is the answer... (From step 2 and 6)

Step-by-step explanation:

Divide the number in two parts with one part containing only the number at unit's place say part 'A', and other part say 'B', containing the remaining number.

Now square the number at unit's place. The square will be one of these; {0,1,4,9,16,25,36,49,64,81}. The unit's place digit in this square is the unit's place digit in actual final answer.Write it in the answer. If the square of digit at unit's place is a two digit no like from 16 to 81 in above set; write only the digit at unit's place from this square in the final answer and carry the remaining digit.

Multiply the actual number to be squared by part 'B'(the remaining part than the number at unit's place as described in step 1 ).

Multiply the parts 'A' and 'B'.

Add results of step 3 with results of step 4.

Add the carried digit from step 2 to the sum in prior step, that is step 5.

Now write this sum before the number we wrote at unit's place of final answer in step 2.

This number we now obtain from step 7, is the square of our number.

User Jayraynet
by
3.2k points