while and do while Loop
Quiz
•
Computers
•
10th Grade
•
Hard
Neeraj Kumar
Used 61+ times
FREE Resource
Enhance your content in a minute
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
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Variabel dan Tipe Data
Quiz
•
10th Grade
10 questions
Microsoft Excel
Quiz
•
10th Grade
10 questions
python quiz
Quiz
•
6th Grade - Professio...
15 questions
tpr2_u0_initial test
Quiz
•
10th Grade
10 questions
BÀI KIỂM TRA GIỮA KÌ 2 - LỚP 3
Quiz
•
1st - 10th Grade
13 questions
Python Recap Challenge
Quiz
•
10th Grade
14 questions
Pre-test: On Online searching by Innovative Teaching Ideas)
Quiz
•
6th - 12th Grade
15 questions
Basics in Java
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Computers
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
20 questions
Halloween movies trivia
Quiz
•
7th - 12th Grade
15 questions
Halloween Characters
Quiz
•
7th - 12th Grade
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
10 questions
Halloween Trivia Challenge
Interactive video
•
6th - 10th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
14 questions
Halloween Fun
Quiz
•
2nd - 12th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
