Connect Me

twitterfacebookgoogle plus email

  Instagram View Biwas Bhattarai's profile on LinkedIn

WAP using SUB procedure to print the series, 1, 12, 123, 1234, 12345.

WAP using SUB procedure to print the series, 1, 12, 123, 1234, 12345.

DECLARE SUB SERIES()
CLS
CALL SERIES
END

SUB SERIES()
A=1
B=2
FOR I=1 TO 5
PRINT A
A=(A*10)+B
B=B+1
NEXT I
END SUB

OR ALTERNATIVELY
DECLARE SUB SERIES(A$)
CLS
A$="12345"
CALL SERIES(A$)
END

SUB SERIES(A$)
FOR I=1 TO 5
PRINT LEFT$(A$,I)
NEXT I
END SUB

Ą
https://www.flickr.com/photos/spklg/15211044551/