IF-ELSE statement test April 29, 2025 by atanubisws@gmail.com 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? To loop a set of statements To choose between two actions based on a condition To define variables To end a program 2 / 10 Which of the following is the correct syntax of an IF...ELSE statement in QBasic? IF condition THEN statement ELSE statement IF (condition) THEN {statement} ELSE {statement} IF condition THEN ELSE statement IF-THEN-ELSE condition 3 / 10 What will the following code display?LET a = 10IF a > 5 THENPRINT "Greater"ELSEPRINT "Smaller" Smaller Greater Nothing Error 4 / 10 Which symbol is used for 'not equal to' in QBasic? != =/= ~= 5 / 10 What will the following QBasic code output?LET num = 0IF num <> 0 THENPRINT "Non-zero"ELSEPRINT "Zero" Non-zero Zero Error Nothing 6 / 10 Which of the following conditions is true in QBasic? 10 = 20 5 < 2 7 >= 3 15 15 7 / 10 What will happen if there is no ELSE part in an IF...ELSE statement and the condition is false? The program stops The IF block runs Nothing happens It shows an error 8 / 10 How many ELSE blocks can be used in one IF statement in QBasic? Multiple Two One None 9 / 10 Which of the following is a valid condition in QBasic? IF a + b THEN IF (a = b) THEN IF a := b THEN IF a equal b THEN 10 / 10 What will this code output?x = 5IF x < 0 THENPRINT "Negative"ELSEPRINT "Positive" Negative Positive 0 Error Your score isThe average score is 53% 0% Restart quiz
Interesting exercise.
I am satisfied with my result
Intresting questions
Thank you