Java: repetition control structure for & while

Java: repetition control structure for & while

10th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Pengenalan Aplikasi Blender

Pengenalan Aplikasi Blender

11th Grade

13 Qs

Test on Python Function

Test on Python Function

11th - 12th Grade

12 Qs

Types of Mass Media

Types of Mass Media

10th Grade - Professional Development

11 Qs

Common Protocols

Common Protocols

10th - 12th Grade

15 Qs

UH Bab 3 XII 3

UH Bab 3 XII 3

12th Grade

10 Qs

LENGUAJE C

LENGUAJE C

11th Grade

13 Qs

Basic computer

Basic computer

9th - 12th Grade

8 Qs

Word 2016 Lesson 1

Word 2016 Lesson 1

9th - 12th Grade

10 Qs

Java: repetition control structure for & while

Java: repetition control structure for & while

Assessment

Quiz

Computers

10th - 12th Grade

Practice Problem

Hard

Created by

Nor Ibrahim

Used 83+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?