MCQs on Iterative Statements in Java

MCQs on Iterative Statements in Java

University

17 Qs

quiz-placeholder

Similar activities

แข่งขันcodingม.ปลาย

แข่งขันcodingม.ปลาย

12th Grade - University

15 Qs

Mastering Python: Lists, Dicts, and Loops

Mastering Python: Lists, Dicts, and Loops

University

20 Qs

PPL 223 ( QUIZ 2) Syntax and Semantics

PPL 223 ( QUIZ 2) Syntax and Semantics

University

20 Qs

Understanding Loops in C Programming

Understanding Loops in C Programming

1st Grade - University

15 Qs

Quiz sobre el ornitorrinco y la programación

Quiz sobre el ornitorrinco y la programación

8th Grade - University

15 Qs

Pretest Alpro Dasar

Pretest Alpro Dasar

University

20 Qs

Python for loop/lists

Python for loop/lists

9th Grade - University

15 Qs

Introduction To Programming - Lesson Exception Handling

Introduction To Programming - Lesson Exception Handling

11th Grade - University

13 Qs

MCQs on Iterative Statements in Java

MCQs on Iterative Statements in Java

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Geshani ITUM

Used 19+ times

FREE Resource

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which statement is used for looping in Java?

if-else

while

switch

try-catch

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is another term for iterative statements in Java?

Decision-making statements

Looping statements

Jump statements

None of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What will the following while loop print? int i = 1; while (i <= 3) { System.out.println(i); i++; }

123

1 2 3

3 2 1

Infinite loop

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

How does a do-while loop differ from a while loop?

A do-while loop does not use conditions

A do-while loop executes at least once

A do-while loop is faster

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which keyword is used to exit a loop prematurely?

exit

stop

break

return

6.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is the output of the following code? for (int i = 0; i < 3; i++) { System.out.print(i + " "); }

0 1 2

0 1 2 3

1 2 3

Compilation error

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

A nested for loop is used when:

We want to iterate only once

Multiple iterations depend on each other

We have conditional statements

None of the above

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?