Inter-School Robotics C Do...While Quiz

Inter-School Robotics C Do...While Quiz

9th - 12th Grade

5 Qs

quiz-placeholder

Similar activities

KS3 Computing -- Iteration: FOR or WHILE?

KS3 Computing -- Iteration: FOR or WHILE?

7th - 9th Grade

10 Qs

Edhesive Python Unit 4: Test Review

Edhesive Python Unit 4: Test Review

10th - 11th Grade

10 Qs

2.2.1 Programming Constructs

2.2.1 Programming Constructs

12th Grade

10 Qs

Python 146- While Loops

Python 146- While Loops

4th Grade - Professional Development

10 Qs

Java Array Review Quiz

Java Array Review Quiz

12th Grade

9 Qs

REVIEW QUIZ FOR & WHILE LOOP

REVIEW QUIZ FOR & WHILE LOOP

10th Grade

10 Qs

Week 3 Arduino Basics Quiz

Week 3 Arduino Basics Quiz

7th - 12th Grade

10 Qs

Code.org Unit 5 - Loops

Code.org Unit 5 - Loops

9th - 12th Grade

10 Qs

Inter-School Robotics C Do...While Quiz

Inter-School Robotics C Do...While Quiz

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

jana mb

Used 2+ times

FREE Resource

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