
Class 8 Switch if else

Quiz
•
Computers
•
8th Grade
•
Hard
Pratibha Sukhija
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is the alternative to SWITCH in Java language?
break, continue
for, while
if-else
goto, exit
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the keywords used to implement a SWITCH case in Java language?
switch, case
default
break
All of above
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the correct syntax of SWITCH statement in Java below.
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default: //statements;
};
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default: //statements;
}
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default case: //statements;
};
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of Java program with SWITCH below?
int a=10;
switch(a)
{
case 10: System.out.println("TEN");
}
No Output
TEN
Compiler error as there is no break
None
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the below Java program?
int persons = 45;
int random = 45;
switch(random)
{
case persons: System.out.print("CRICKET ");
default: System.out.println("RUGBY");
}
CRICKET
CRICKET RUGBY
RUGBY
Compiler error
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of Java program below?
int num=40;
switch(num)
{
case 5: System.out.println("FIVE"); break;
case 35+5: System.out.println("FORTY"); break;
case 20+30: System.out.println("FIFTY");
}
FIVE
FORTY
FIFTY
Error
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of the below Java program?
final int persons = 45;
int random = 45;
switch(random)
{
case persons: System.out.print("CRICKET ");
default: System.out.println("RUGBY");
}
CRICKET
CRICKET RUGBY
RUGBY
Compiler error
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Retro Games

Quiz
•
8th Grade
14 questions
Conditionals in JavaScript

Quiz
•
7th - 8th Grade
13 questions
Intro to IF statements

Quiz
•
KG - University
16 questions
VEX Electrical Systems

Quiz
•
6th - 8th Grade
11 questions
Java Printing Quiz

Quiz
•
8th Grade
20 questions
Computer Networks

Quiz
•
8th Grade
20 questions
KS3 Operating Systems

Quiz
•
7th - 9th Grade
19 questions
Java Basic 1 - Quiz

Quiz
•
8th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

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

Interactive video
•
6th - 10th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade
25 questions
How to Email a Teacher- https://youtu.be/NioeNhfpVfI

Quiz
•
6th - 8th Grade
20 questions
Computer Hardware

Quiz
•
6th - 8th Grade
21 questions
Gear Ratio Practice

Quiz
•
6th - 8th Grade