LOOP

LOOP

11th Grade

10 Qs

quiz-placeholder

Similar activities

Quis code blocks

Quis code blocks

11th Grade

10 Qs

JavaScript Basics Quiz

JavaScript Basics Quiz

9th - 12th Grade

9 Qs

Quiz Larik (Array)

Quiz Larik (Array)

11th Grade - University

13 Qs

Bài 26

Bài 26

10th Grade - University

15 Qs

Understanding Loops in C Programming

Understanding Loops in C Programming

1st Grade - University

15 Qs

Test de C++ pentru clasa a 10-a

Test de C++ pentru clasa a 10-a

10th Grade - University

15 Qs

2DS_FRONT_END_JavaScript For Loop

2DS_FRONT_END_JavaScript For Loop

11th Grade

10 Qs

Struktur Pemrograman Arduino

Struktur Pemrograman Arduino

11th Grade

10 Qs

LOOP

LOOP

Assessment

Quiz

Information Technology (IT)

11th Grade

Hard

Created by

Magiel Boncayao

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop is guaranteed to execute at least once?

A) for loop

B) while loop

C) do-while loop

Enhanced for loop

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following WHILE loop?

int x = 5;

while (x > 0){

  System.out.print(x + " ");

  x--

}

A) 5 4 3 2 1 0

B)  5 4 3 2 1

C) 4 3 2 1 0

D) Infinite loop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main difference between a while loop and a do-while loop?

  • A) while checks the condition before execution; do-while checks after.

  • B) while runs at least once; do-while may not run at all.

  • C) do-while is faster than while.

  • D) There is no difference.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times will this loop execute?

int i = 5; while (i < 5) { System.out.println("Hello"); i++; }

  • A) 0

  • B) 1

  • C) 5

  • D) Infinite

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if the condition in a while loop is always true?

  • A) The loop runs once.

  • B) The loop runs a finite number of times.

  • C) The loop becomes infinite.

  • D) Compilation error.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this code?

int x = 1; do { System.out.print(x + " "); x++; } while (x <= 3);

  • A) 1 2 3

  • B) 1 2

  • C) 2 3

  • D) Infinite loop

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop is this an example of?

int i = 0; do { System.out.println(i); i++; } while (i < 5);

  • A) for loop

B) do-while loop

C) while loop

  • D) if-else loop

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?