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 Find the Factors of Given Number. (Qbasic Code)

To Find the Factors of Given Number.
  •  CLS
    INPUT "Enter any number"; n
    FOR i = 1 TO n
        x = n MOD i
        IF x = 0 THEN
            PRINT i;
        END IF
    NEXT i
    END
 To Find the Factors of Given Number Using COMMON SHARED.
  • DECLARE SUB factor ()
    COMMON SHARED n
    CLS
    CALL factor
    END

    SUB factor
    INPUT "Enter any number"; n
    FOR i = 1 TO n
        x = n MOD i
        IF x = 0 THEN
            PRINT i;
        END IF
    NEXT i
    END SUB

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.