Java - If Else Switch

Java - If Else Switch

9th - 12th Grade

6 Qs

quiz-placeholder

Similar activities

Year 10 IT - CN - Key Words

Year 10 IT - CN - Key Words

8th - 11th Grade

10 Qs

JavaScript 2

JavaScript 2

12th Grade

10 Qs

AP1 - 1º Trim - 1ª Serie - Tecnico - Lógica Computacional

AP1 - 1º Trim - 1ª Serie - Tecnico - Lógica Computacional

11th Grade

10 Qs

Alapismeretek

Alapismeretek

7th - 12th Grade

10 Qs

ExamenHojasdecalculo

ExamenHojasdecalculo

10th Grade

10 Qs

Java: repetition control structure for & while

Java: repetition control structure for & while

10th - 12th Grade

10 Qs

Lesson 1 Introduction to Database System

Lesson 1 Introduction to Database System

10th Grade

10 Qs

Review

Review

9th - 12th Grade

10 Qs

Java - If Else Switch

Java - If Else Switch

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

taha Rupawala

Used 15+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

6 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

What are the conditional statements in Java

else if

switch

if switch

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 time = 16;

if(time > 12)

{

System.out.println("Good Afternoon");

}

else

{

System.out.println("Good night");

}

Good Night

Good night

Good Afternoon

Good afternoon

4.

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

Error

Hello world

Hello World

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

FILL IN THE BLANKS:

int x = 50;

int y = 10;

__ ( x__y)

{

System.out.println("Hello World");

}

if, <

else, >

if, >

if, %

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

FILL IN THE BLANK:

int x = 50;

int y = 50;

__(x__y)

{

System.out.println("1");

}

__(x>y)

{

System.out.println("2");

}

__

{

System.out.println("3");

}

if, ==, else if, else

else, %, if else if, else

else if, if, else, if

if, --, else if, else