FOR X = 1 TO 5
PRINT X * X
NEXT X
Answers
Answered by
2
Given C∅de Snippet:
FOR X = 1 TO 5
PRINT X * X
NEXT X
Output:
1
4
9
16
25
Note: For verification, check out the attachment.
Explanation:
- The given program displays the square of numbers in the range 1 to 5.
- We can see that the loop iterates in the range X = 1 to 5. As step value is not mentioned, it is considered as - 1. After each iteration, the loop displays the value of X times X which is equal to the squares of numbers in the range.
Attachments:
![](https://hi-static.z-dn.net/files/d38/6463233ebf17088a1223386448a9546f.jpg)
Similar questions