IF-ELSE statement test

qbasic output
WhatsApp Group Join Now
Telegram Group Join Now

IF-ELSE statement test

1 / 10

What is the purpose of an IF...ELSE statement in QBasic?

2 / 10

Which of the following is the correct syntax of an IF...ELSE statement in QBasic?

3 / 10

What will the following code display?

LET a = 10
IF a > 5 THEN
PRINT "Greater"
ELSE
PRINT "Smaller"

4 / 10

Which symbol is used for 'not equal to' in QBasic?

5 / 10

What will the following QBasic code output?

LET num = 0
IF num <> 0 THEN
PRINT "Non-zero"
ELSE
PRINT "Zero"

6 / 10

Which of the following conditions is true in QBasic?

7 / 10

What will happen if there is no ELSE part in an IF...ELSE statement and the condition is false?

8 / 10

How many ELSE blocks can be used in one IF statement in QBasic?

9 / 10

Which of the following is a valid condition in QBasic?

10 / 10

What will this code output?

x = 5
IF x < 0 THEN
PRINT "Negative"
ELSE
PRINT "Positive"

Your score is

The average score is 53%

0%

4 thoughts on “IF-ELSE statement test”

Leave a Comment