Search Header Logo

Quiz on Selective Structures in Programming

Authored by NUR ENZAI

Computers

University

Used 3+ times

Quiz on Selective Structures in Programming
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the most basic selective statement?

while loop

for loop

if statement

switch statement

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if the condition in an if statement is FALSE?

The statement is executed

The statement is skipped

The program terminates

The condition is re-evaluated

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In an if...else statement, what is executed if the condition is TRUE?

Statement B

Statement A

Both statements

None of the statements

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the switch...case statement?

To create loops

To define functions

To execute a single statement

To substitute for long if statements

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What must follow each case label in a switch statement?

exit

break

return

continue

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a nested if structure involve?

Multiple switch statements

An if statement within another if statement

A function within an if statement

A loop within an if statement

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for an if...else...if statement?

if condition 1, statement 1; else if condition 2, statement 3;

if condition 1, statement 1; else statement 2;

if condition 1, statement 1; else if condition 2, statement 2;

if condition 1, statement 1; if condition 2, statement 2;

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers