Java Conditional Constructs

Quiz
•
Computers
•
9th - 10th Grade
•
Hard
Anubha Pal
Used 170+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public void main()
{
double temp = 56.0;
if (temp <=54.0 && temp>40)
System.out.println(“It is too hot”);
else if ( temp<40 || temp>30)
System.out.println(“It is hot but not too much”);
else
System.out.println(“It is pleasant”);
}
What will be the output?
It is too hot
It is pleasant
It is hot but not too much
runtime error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
PREDICT THE OUTPUT:
int x = 20;
int y = 18;
if(x>y)
System.out.println("x is greater than y");
else
{
System.out.println("Error");
System.out.println("Incorrect code");
}
Error
Incorrect code
x is greater than y
Error
Incorrect code
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
PREDICT THE OUTPUT:
int x = 60;
int y = 90;
if (y%x == 0 && y-x==30)
{
System.out.println("Hello World");
}
else
{
System.out.println("Error")
}
Hello World
Hello World
Error
Error
Hello world
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of above statement-
5
No output
6
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
5. If a, b and c are the sides of a triangle then which of the following statement is true for:
if(a==b && a==c && b==c)?
Equilateral triangle
Scalene triangle
Isosceles triangle
All of the above
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a switch case, when the switch value does not respond to any case then the execution transfers to:
break
default
loop
none
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Condition is essentially formed using:
Arithmetic operators
Relational operators
Logical operators
None
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Basics in Java

Quiz
•
9th - 12th Grade
19 questions
TechfestQuiz 2024

Quiz
•
9th - 12th Grade
15 questions
Class X - Java 1

Quiz
•
10th Grade
20 questions
QUIS PERULANGAN & PERCABANGAN

Quiz
•
10th Grade
20 questions
Java Casting & Booleans

Quiz
•
10th - 12th Grade
15 questions
Python Basics Quiz

Quiz
•
6th - 10th Grade
20 questions
Year 10s quiz

Quiz
•
9th Grade
16 questions
Java Conditional Statements

Quiz
•
9th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade