Home  |  IT Zone  |  Tips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  World Infos  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Fun / Jokes  |  Decent Quotes  |  Birthday Msgs  |  Good Morning Msgs  |  Good Night Msg  |  Husband Wife Jokes  |  Teacher Students Jokes  |  Insult Jokes  |  Love Quotes  |  Sad Quotes  |  Funny Pics  |  Be Aware  |  Articles  |  Simple Joys of Life 

To generate the series- 2, 22, 222, 2222, 22222 (Qbasic Code)

To generate the series-  2, 22, 222, 2222, 22222

Using FOR .... NEXT
  • CLS
    a = 2
    FOR i = 1 TO 5
        PRINT a;
        a = a * 10 + 2
    NEXT i
    END

Using WHILE ..... WEND
  • CLS
    a = 2
    c = 1
    WHILE c <= 5
        PRINT a;
        a = a * 10 + 2
        c = c + 1
    WEND
    END

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.