8051

8051 code to find a square of first 10 natural numbers and store it in an array.

8051 code to find a square of first 10 natural numbers and store it in an array.

In this article let’s learn how to find the square of first 10 natural numbers and store them in an array.

Algorithm:

1)Initialize R0 with memory address where all squares are stored and R1 with 0.
2)Increment R1 to find the square of a number.
3)Find the square of a number by multiplying A and B with same number.
4)Store the result with the assigned address array.
5)Check whether R1 is 10 and if it not 10 repeat the above steps.
In this program let’s see how to find a square of first 10 natural numbers and store it in an array.

Code goes here:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.