QBasic Programming

WAP to display

*
**
***
****
*
**
***
****
*
*
*
*
CLS
S$ = "****"
FOR I = 1 TO LEN(S$)
PRINT LEFT$(S$, I)
NEXT I

FOR J = 1 TO LEN(S$)
PRINT LEFT$(S$, I)
NEXT J

FOR K = 1 TO LEN(S$)
PRINT MID$(S$, K, 1)
NEXT K

END

USING SUB PROCEDURE
DECLARE SUB PATTERN1 (S$)
DECLARE SUB PATTERN (S$)
CLS
S$ = "****"
CALL PATTERN(S$)
CALL PATTERN(S$)
CALL PATTERN1(S$)
END

SUB PATTERN (S$)
FOR I = 1 TO LEN(S$)

PRINT LEFT$(S$, I)

NEXT I
END SUB

SUB PATTERN1 (S$)
FOR K = 1 TO LEN(S$)
PRINT MID$(S$, K, 1)
NEXT K

END SUB
                 

WAP to display (Prev Lesson)
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!