Search Header Logo

Topic 5-2: do while loop

Authored by Adila Nordin

Computers

University

Used 13+ times

Topic 5-2: do while loop
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct format of a do while loop?

do-while(condition);

{

//statement

}

do{

//statement

}while(condition);

do-while(condition)

{

//statement

}

do{

//statement

}while(condition)

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What is the main difference between a while and a do while loop in Java? (can select more than 1 answer)

while loop executes the statements inside of it at least once even if the condition is false.

do while loop executes the statements inside of it at least once even if the condition is false.

while loop will not executes the statements inside of it if the condition is false.

do while loop will not executes the statements inside of it if the condition is false.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about do while loop is true?

do while statement is an alternative to multiple if else statement.

do while statement only executes if the condition/expression is false.

do while statement is written as do (condition) while.

do while statement will execute at least once before testing its condition/expression.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a do while loop, the condition is evaluated at the _____ of the statement.

start

end

middle

never

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times a do while loop is guaranteed to loop?

0

1

Infinitely

Can't say, need to check when the condition becomes false.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the code?

5

5 2

5 2 0

Error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the code?

11

5

11 16

Error

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