Computer Science, asked by arpitmasih754, 3 months ago

FOR X = 1 TO 5
PRINT X * X
NEXT X​

Answers

Answered by anindyaadhikari13
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:
Similar questions