
Java Control Statements MCQs
Authored by Mohd. Khan
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int x = 5; if (x > 2) if (x < 10) System.out.println("A"); else System.out.println("B");
A
B
Compilation error
No output
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int i = 0; while (i < 3) { System.out.print(i + " "); i++; }
0 1 2
1 2 3
0 1 2 3
Infinite loop
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int a = 10; do { System.out.print(a + " "); a -= 3; } while (a > 0);
10 7 4 1
10 7 4
10 7
Infinite loop
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
for (int i = 1; i <= 5; i++) { if (i == 3) break; System.out.print(i + " "); }
1 2 3
1 2
1 2 3 4 5
3
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
for (int i = 1; i <= 3; i++) { for (int j = 1; j <= 2; j++) { System.out.print(i * j + " "); } }
1 2 2 4 3 6
1 2 4 8 12
1 2 2 3 3 4
1 1 2 2 3 3
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int x = 4; switch (x) { case 1: System.out.println("One"); case 2: System.out.println("Two"); default: System.out.println("Default"); }
One
Default
Two Default
Default only
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int i = 1; while (i <= 5) { if (i == 3) continue; System.out.print(i + " "); i++; }
1 2 3 4 5
1 2 4 5
Infinite loop
1 2 3 4
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
25 questions
Soal Untuk Pengetahuan Teknologi Intelijen
Quiz
•
University
25 questions
MOBILE DEVICE
Quiz
•
1st Grade - University
25 questions
Privacy, Security & Ethics
Quiz
•
University
25 questions
UTS KEAMANAN
Quiz
•
University
30 questions
HCI-Chapter 8
Quiz
•
University
27 questions
EE08 - vol 2
Quiz
•
University
26 questions
TUGAS PEMBINAAN INFORMATIKA KELAS 8 SMP ISA
Quiz
•
8th Grade - University
25 questions
Quiz on Emotional Interaction
Quiz
•
University
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Computers
8 questions
2 Step Word Problems
Quiz
•
KG - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
10 questions
14.2 Independent/Dependent Variables
Quiz
•
KG - University
18 questions
Great Lakes States
Quiz
•
KG - University
7 questions
DNA, Chromosomes, Genes, and Traits: An Intro to Heredity
Interactive video
•
11th Grade - University
7 questions
Reflexive Verbs in Spanish
Lesson
•
9th Grade - University
7 questions
Narrative Writing 1
Interactive video
•
4th Grade - University