Wednesday, October 16, 2019

46. Qbasic Program to display only perfect square numbers between 1 to 100


46.      Write a program to display only perfect square numbers between 1 to 100 using SUB-END SUB.

DECLARE SUB PERFECT ( )
CLS
CALL PERFECT
END
SUB PERFECT ()
FOR N = 1 TO 100
    S = SQR(N)
    IF S = INT(S) THEN PRINT N,
NEXT N
END SUB

No comments:

Post a Comment