Search Header Logo

Inter-School Robotics C Do...While Quiz

Authored by jana mb

Computers

9th - 12th Grade

Used 2+ times

Inter-School Robotics C Do...While Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

A DO...While loop in C only executes/repeats if...

The condition is TRUE

The condition is FALSE

2.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

What is the correct syntax for a Do...While loop in C that ONLY executes if x is not equal to 5?

do{

condition

}while (x != 5)

do{

condition

}while(x <> 5);

do{

condition

}while(x != 5);

do{

condition

}while(x == 5);

3.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

What is the difference between a While loop and a Do...While loop in C?

A While loop executes if the condition is false whereas a Do...While loop executes if a condition is true

A While loop checks if the condition is true before executing but a Do...While loop checks the condition after executing and only executes when a condition is true

There is no difference, both the While and Do...While loop are the same and can be used interchangeably

A While loop checks if the condition is true after executing but a Do...While loop checks the condition before executing and only executes when a condition is true

4.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

Media Image

How many times would the following Do...While loop execute in the code shown?

5

6

7

Infinite loop

5.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

Which of the following errors from the snippet of C code would result in causing an infinite loop in a Do...While?

int i=0;

do{

printf("Oranges");

i -- ;

}while(i < 10);

int i=0;

do{

printf("Oranges");

}while(i < 10);

int i=0;

do{

printf("Oranges");

i ++ ;

}while(i == 0);

All of the above

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?