WAP to print square of first 9 natural numbers

Qbasic program to print square of first 9 natural numbers


1,4,9...81


CLS
 FOR I = 1 TO 9
 PRINT I ^ 2
 NEXT I
 END

USING SUB


DECLARE SUB SQUARE()
 CLS
 CALL SQUARE
 END
 
 SUB SQUARE
 FOR I = 1 TO 9
 PRINT I ^ 2
 NEXT I
 END SUB

Post a Comment

0 Comments