In a While loop a code will be repeated until the condition becomes
while and do while Loop

Quiz
•
Computers
•
10th Grade
•
Hard
Neeraj Kumar
Used 59+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
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
Similar Resources on Quizizz
10 questions
Recursion Contest

Quiz
•
10th - 12th Grade
12 questions
Loops

Quiz
•
9th - 12th Grade
15 questions
Input Commands Quiz

Quiz
•
10th Grade
14 questions
C++ - Loops and Random Numbers

Quiz
•
9th - 12th Grade
15 questions
CP M4 Repetition & Loops

Quiz
•
9th - 12th Grade
15 questions
Java Basic Data Structures

Quiz
•
6th - 10th Grade
13 questions
APCSA Unit 3 Review

Quiz
•
9th - 12th Grade
16 questions
Python Beginner

Quiz
•
9th - 10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University