Java: repetition control structure for & while

Quiz
•
Computers
•
10th - 12th Grade
•
Hard
Nor Ibrahim
Used 83+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What should be written in the bracket?
int count = 0;
for (______? ){
count = count + 2;
}
System.out.print(count);
output : 6
int i = 1; i < 3; i=i+1
int i = 0; i <= 3; i=i+1
int i = 0; i < 3; i=i+1
int i = 0; i = 3; i=i+1
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
________?__________ ; //initialization
int max = 20;
for (int i = 0; i > max; i=i+1) {
count = pow(count , i);
}
System.out.print(count);
output : 2
double count = 2
Double count = 2
double[ ] count = 2
new double [ ] count = 2
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
output : 1 2 3 4 5 6 7 8 9
int n = 10;
for(int i; i < n;i=i+1)
{
System.out.print("\t"+i);
}
int n = 10;
for(int i=1; i < n;i=i+1)
{
System.out.print("\t"+i);
}
int n = 9;
for(int i; i < n;i=i+1)
{
System.out.println("\t"+i);
}
int n = 9;
for(int i; i <= n;i=i+1)
{
System.out.println("\t"+i);
}
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
output :
10
9
8
7
6
for(int x=10;x>5;x--){
System.out.print(x"\n");
}
for(int x=0;x>10;x++){
System.out.print(x"\n");
}
for(int x=6;x>10;x--){
System.out.print(x"\n");
}
for(int x=10;x>=5;x--){
System.out.print(x"\n");
}
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
output :
0
2
4
6
8
10
12
14
int n = 15;
for(i= 0; i <= n; i+= 2)
{
System.out.print(i"\t");
}
int n = 0;
for(i= 0; i <= 15; i+= 2)
{
System.out.print(i"\n");
}
int n = 15;
for(i= 0; i <= n; i++)
{
System.out.print(i"\n");
}
int n = 15;
for(i= 0; i <= n; i+= 2)
{
System.out.print(i"\n");
}
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int count = 0;
int j = 4;
while( j >= 1) {
count = count + j;
j=j-1;
}
System.out.println(count);
what is the output?
12
8
10
14
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int i = 0;
while (i < 5) {
System.out.println(i);
i++;
}
what is the output?
0
1
2
3
4
1
2
3
4
5
0
1
2
3
4
5
5
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Quiz 13 - For Loops

Quiz
•
11th Grade
14 questions
циклы в Python

Quiz
•
10th Grade
12 questions
Linguagem C parte II

Quiz
•
12th Grade
15 questions
G8 Practice PC

Quiz
•
12th Grade
10 questions
S For loops

Quiz
•
10th Grade
15 questions
CSE_CodeHS_intro_python_unit_3_5

Quiz
•
9th - 12th Grade
12 questions
Project-Stem Unit 1 python coding

Quiz
•
9th - 12th Grade
10 questions
Викторина по Python (Урок 1-2)

Quiz
•
5th - 11th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade