JAVA control Structure

JAVA control Structure

Professional Development

12 Qs

quiz-placeholder

Similar activities

Let's Play Together

Let's Play Together

University - Professional Development

10 Qs

Guess the Retro Computer 1

Guess the Retro Computer 1

KG - Professional Development

13 Qs

Unit 1 lesson 1

Unit 1 lesson 1

University - Professional Development

15 Qs

CodeMonkey Platform Management & Resources

CodeMonkey Platform Management & Resources

Professional Development

10 Qs

INTO Artificial Intelligence

INTO Artificial Intelligence

University - Professional Development

10 Qs

Computer basics for beginners

Computer basics for beginners

Professional Development

15 Qs

GUESS THAT WORD IN CYBER!

GUESS THAT WORD IN CYBER!

Professional Development

10 Qs

SJDMNHS Google Classroom 2

SJDMNHS Google Classroom 2

Professional Development

10 Qs

JAVA control Structure

JAVA control Structure

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

Dr Manishankar S

Used 32+ times

FREE Resource

AI

Enhance your content in a minute

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

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a selection statement in Java?

for

switch

while

do-while

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? int x = 5; if (x > 2) System.out.println("A"); else System.out.println("B"); System.out.println("C");

A C

B C

A

C

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop executes at least once, regardless of the condition?

while

for

do-while

switch

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The statement continue; inside a loop:

Terminates the loop immediately

Skips the rest of the loop body and jumps to the next iteration

Exits the program

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? for (int i = 1; i <= 3; i++) { if (i == 2) break; System.out.print(i + " "); }

1 2 3

1

1 2

2 3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct way to read an integer from console using Scanner?

int x = Scanner.nextInt();

Scanner sc = new Scanner(System.in); int x = sc.nextInt();

sc.nextInt(); Scanner sc = new Scanner(System.in);

None of these

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, System.out.println() is used to:

Read data from console

Print data to console followed by a newline

Print data without newline

None of the above

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?