WAP to generate/print the pattern : 1,23,456,78910

Qbasic program to generate/print the pattern : 1,23,456,78910


1 23 456 78910


CLS
 N = 1
 FOR I = 1 TO 4
 FOR J = 1 TO I
 PRINT N;
 N = N + 1
 NEXT J
 PRINT
 NEXT I
 END

USING SUB


DECLARE SUB PATTERN()
 CLS
 CALL PATTERN
 END
 
 SUB PATTERN
 N = 1
 FOR I = 1 TO 4
 FOR J = 1 TO I
 PRINT N;
 N = N + 1
 NEXT J
 PRINT
 NEXT I
 END SUB

Post a Comment

0 Comments