
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
34 questions
Computer Classification
Quiz
•
University
25 questions
PreAssessment_Computer Basics
Quiz
•
University
25 questions
TechZoom24-BugBash_Prelims
Quiz
•
University
25 questions
Future Technologies Quiz
Quiz
•
6th Grade - University
25 questions
DSU-NTD-Quiz
Quiz
•
University
30 questions
Linux Quiz (RHCSA)
Quiz
•
University
25 questions
Python Module 1
Quiz
•
University
25 questions
OSI yuk
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade