while and do while Loop

while and do while Loop

10th Grade

11 Qs

quiz-placeholder

Similar activities

What is a computer

What is a computer

KG - University

11 Qs

Spoljna memorija - HDD

Spoljna memorija - HDD

9th - 11th Grade

10 Qs

Program Implementation

Program Implementation

10th - 12th Grade

15 Qs

Cấu trúc For trong Python

Cấu trúc For trong Python

10th Grade

15 Qs

Pemrograman Dasar

Pemrograman Dasar

10th Grade

10 Qs

Technology Week HTG Quiz - Monday

Technology Week HTG Quiz - Monday

7th - 12th Grade

10 Qs

Ôn tập kỳ 2 tin 6

Ôn tập kỳ 2 tin 6

1st - 12th Grade

15 Qs

while and do while Loop

while and do while Loop

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Neeraj Kumar

Used 61+ times

FREE Resource

AI

Enhance your content in a minute

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

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a While loop a code will be repeated until the condition becomes

FALSE

TRUE

User choice

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Print i as long as i is less than 6.

What will be the code?

i = 1

while i < 6:

print(i)

i += 1

i = 1

when i < 6;

print(i)

i += 1

i = 1

i < 6:

print(i)

i += 1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In programming, what is iteration?
The repetition of steps within a program
The order in which instructions are carried out
A decision point in a program
Testing a program to make sure it works

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct format of a do-while loop?

do-while(condition);

{

//code

}

do{

//code

}while(condition);

do-while(condition)

{

//code

}

do{

//code

}while(condition)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

14) What is the output of the below Java program?

int a=1;

while(a<4)

{

System.out.print(a + " ");

a++;

}

1 2 3 4

1 2 3

6

Compiler error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the below Java program with a decrement operator and WHILE-loop?

int a=4;

while(a>0)

{

System.out.print(a + " ");

a--;

}

4 3 2 1

3 2 1

Compiler error

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main difference between a WHILE and a DO-WHILE loop in Java?

WHILE loop executes the statements inside of it at least once even if the condition is false.

DO-WHILE loop executes the statements inside of it at least once even if the condition is false.

WHILE loop is fast.

DO-WHILE loop is fast.

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?