Control Statements in JAVA

Control Statements in JAVA

University

10 Qs

quiz-placeholder

Similar activities

Quiz Microprogramming

Quiz Microprogramming

University

15 Qs

Python Quiz 1.4

Python Quiz 1.4

University

12 Qs

Perangkat komputer

Perangkat komputer

University

10 Qs

Quis 1 APSI

Quis 1 APSI

University

10 Qs

Computational Thinking in Python[Quiz 3]

Computational Thinking in Python[Quiz 3]

University

15 Qs

JRB2 Quiz 4

JRB2 Quiz 4

University

10 Qs

Control Statements in JAVA

Control Statements in JAVA

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

RAVIKANTH K

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

public class ControlStatement1 {

public static void main(String[] args) {

if(true){

System.out.println("If condition true");

}

}

}

Compile time Error

Run time Error

If condition true

NONE

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

public class ControlStatement1 {

public static void main(String[] args) {

if(true){

System.out.println("If condition true");

}else{

System.out.println("Else true");

}

}

}

If condition true

Else true

Both of above

If condition true

Else true

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

int a =5, b=10;

if(a>b || a<b){

System.out.println("A greater than B OR A less than B");

}else{

System.out.println("Invalid Condition");

}

A greater than B

A less than B

A greater than B OR A less than B

Invalid Condition

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is a loop statement?

An statement, which is executed repeatedly

An statement, which is executed once

An statement, which is never executed

None of above

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

for(int i=0; i<10; i+=2){

System.out.print(i);

}

0123456789

02468

0246810

123456789

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

for( ; ; ){

System.out.print("Hello Loop");

}

Run time Error

Compile time error

Hello Loop

Infinite Loop

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

int[] arr = {1, 2, 3, 4}

for(int i:arr){

System.out.println(i);

}

1

2

3

4

Compilation Error

Runtime Error

None

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?

Discover more resources for Computers