In mathematics, a square number or perfect square is an integer that is the square of an integer. In other words, it is the product of some integer with itself. For example, 9 is a square number, since it equals 32 and can be written as 3 × 3.
END IF
NEXT i
END
NEXT i
END
Using SUB Procedure
DECLARE SUB square()
CLS
CALL square
END
SUB square ()
FOR i = 1 TO 100
n = SQR(i)
IF n = INT(n) THEN
PRINT n * n;
CLS
CALL square
END
SUB square ()
FOR i = 1 TO 100
n = SQR(i)
IF n = INT(n) THEN
PRINT n * n;
END IF
NEXT i
END SUB
NEXT i
END SUB
Using FUNCTION Procedure
DECLARE FUNCTION square()
CLS
sq = square
END
FUNCTION square ()
FOR i = 1 TO 100
n = SQR(i)
IF n = INT(n) THEN
PRINT n * n;
CLS
sq = square
END
FUNCTION square ()
FOR i = 1 TO 100
n = SQR(i)
IF n = INT(n) THEN
PRINT n * n;
END IF
NEXT i
END FUNCTION
NEXT i
END FUNCTION
Source : School Tech
No comments:
Post a Comment
If you have any doubts, Please let me know.