34) PERFECT SQUARE OR NOT.(FUNCTION)

by - October 03, 2019

DECLARE FUNCTION PERFECT$ (N)
CLS
INPUT “ENTER A NUMBER” ; N
PRINT PERFECT$ (N)
END

FUNCTION PERFECT$ (N)
S = SQR(N)
IF S = INT(S) THEN
PERFECT$=”PERFECT SQUARE”
ELSE
PERFECT$=”NOT PERFECT SQUARE”
END IF
END SUB

You May Also Like

0 comments