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 print the prime number from 1 to 100.

CLS
FOR i = 2 TO 100
    FOR j = 2 TO i - 1
        IF i MOD j = 0 THEN GOTO a:
    NEXT j
    PRINT i;
    a:
NEXT i
END

Next Method 
  • CLS
    FOR i = 1 TO 100
        c = 0
        FOR j = 1 TO i
            x = i MOD j
            IF x = 0 THEN c = c + 1
        NEXT j
        IF c = 2 THEN
            PRINT i
        END IF
    NEXT i
    END

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.