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 Greatest Number From N Number Supplied (Qbasic Code)

To Find The Greatest Number From N Number Supplied (Qbasic Code)

CLS
c = 1
h=0
INPUT "How many numbers do you want to enter"; n
FOR i = 1 TO n
    INPUT "Enter the number"; x
    IF x > h THEN
        h = x
    ELSE
    END IF
NEXT i
PRINT "The highest number is"; h
END

Next Method  Using WHILE .... WEND
  •  CLS
    g = 0
    c = 1
    INPUT "Enter how many numbers you want to find"; t
    WHILE c <= t
        INPUT "Enter the numbers"; n
        IF n > g THEN
            g = n
        END IF
        c = c + 1
    WEND
    PRINT "The greatest number among supplied numbers is "; g
    END

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.