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 

What is the function and syntax of SELECT CASE statement? (Qbasic)

SELECT CASE –
  • Select Case executes one of several statements blocks depending on the value of expression.
Syntax:
    SELECT CASE expression
        CASE exp 1
            statement 1
        CASE 2
            statement 2
        CASE n
            statement n
        CASE ELSE
            statement
        END SELECT

Example:
    CLS
    INPUT “Enter your choice (1 – 3)”; N
        SELECT CASE N
            CASE 1
                PRINT “Sunday”
            CASE 2
                PRINT “Monday”
            CASE 3
                PRINT “Tuesday”
            CASE ELSE
                PRINT “No data”
        END SELECT   
    END

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.