To generate the pattern. 1 12 123 1234 12345 (Qbasic Code)

To generate the pattern.
1
12
123
1234
12345
  • CLS
    FOR i = 1 TO 5
        FOR j = 1 TO i
            PRINT j;
        NEXT j
        PRINT
    NEXT i
    END

Next Method
  • CLS
    a = 1
    FOR i = 2 TO 6
        PRINT a
        a = a * 10 + i
    NEXT i
    END

Share :

Twitter
Back To Top

facebook main

counter

Powered by Blogger.