
CONDITIONALS
Quiz
•
Computers
•
•
Medium
Zaid Muhammad
Used 4+ times
FREE Resource
Enhance your content in a minute
23 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of conditional statements in Java?
To declare variables
To execute a block of code only if a certain condition is true
To perform mathematical calculations
To define classes and objects
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a logical operator in Java?
++ (Increment)
&& (AND operator)
:: (Method reference)
$ (Dollar sign)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
int x =: 10;
int y = 20;
if (x > y || x<5) {
System.out.println("Condition is true");
} else {
System.out.println("Condition is false");
}
Condition is true
B) Condition is false
C) Compilation error
D) Runtime error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
int x = 5;
if (x > 0 && x < 10) {
System.out.println("Number is between 0 and 10");
} else {
System.out.println("Number is not between 0 and 10");
}
A) Number is between 0 and 10
B) Number is not between 0 and 10
C) Compilation error
D) Runtime error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
int i = 0;
while (i < 5) {
System.out.print(i + " ");
i += 2;
}
A) 0 1 2 3 4
B) 0 2 4
C) 2 4 6 8 10
D) Infinite loop
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Greater than or equal to
> or =
> || =
>=
<=
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What Javascript code matches this statement:
Their name is Kim and they are less than 16 years old
if (name = "Kim" && age < 16 )
if (name === "Kim" && age < 16 )
if (name = "Kim" || age < 16 )
if (name === "Kim" || age < 16 )
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
Already have an account?
Similar Resources on Wayground
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
