Wednesday, October 16, 2019

88. Qbasic Program to display 54321, 5432, 543, 54, 5

88. Write a sub procedure to display 54321, 5432, 543, 54, 5
DECLARE SUB SERIES ( )
CLS
CALL SERIES
END
SUB SERIES
FOR I = 5 TO 1 STEP -1
FOR J = I TO 1 STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END SUB

1 comment:

  1. IT PRINTS 54321
    4321
    321
    21
    1

    IT SHOULD BE

    CLS
    FOR I = 1 TO 5
    FOR J = 5 TO I STEP -1
    PRINT J;
    NEXT J
    PRINT
    NEXT I
    END

    ReplyDelete