
Condition Statements -1

Quiz
•
Computers
•
University
•
Hard
cgokul CELL-HICET
Used 1+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the code snippet and select the correct output
if(true && false && true || false)
System.out.println("True.");
else
System.out.println("False");
True
False
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of following program?
public class temp{
public static void main(String args[]) {
int x=1;
if((boolean)x==true)
System.out.println("True.");
else
System.out.println("False.");
}
}
True
False
Error
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
public class temp
{
public static void main(String args[])
{
int ok=10;
switch(ok)
{
default:
System.out.println("default");
case 0:
System.out.println("true");
case 1:
System.out.println("false");
}
}
}
default
Error
true false default
default true false
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
public class temp
{
public static void main(String args[])
{
boolean ok=true;
switch(ok)
{
case true:
System.out.println("true");
break;
case false:
System.out.println("false");
break;
default:
System.out.println("default");
break;
}
}
}
Error
true
false
default
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
public class temp
{
public static void main(String args[])
{
int x=1;
if(x)
System.out.println("True");
else
System.out.println("False");
}
}
True
False
Error
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
public class temp
{
public static void main(String args[])
{
int x=10;
System.out.println( ((x=5)?"yes":"no") );
}
}
yes
no
Error
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
double x = 6.2;
if(x-- >= 6.0)
System.out.print("first ");
if(--x >= 5.0)
System.out.print("second ");
if(x-- >= 4.0)
System.out.print("third ");
else
System.out.print("fourth ");
first second third
first second fourth
first fourth
first third
8.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
public class temp
{
public static void main(String agrs[])
{
int x=10;
switch(x)
{
case 5: x+= 5;
case 10: x+=10;
case 15: x+=15;
case 20: x+=20;
}
System.out.println(x);
}
}
55
45
20
10
Similar Resources on Wayground
6 questions
Sains Komputer Tingkatan 4 (1.5 Amalan Terbaik Pengaturcaraan)

Quiz
•
7th Grade - Professio...
10 questions
Java Arrays

Quiz
•
University
10 questions
Quiz de Java

Quiz
•
University
12 questions
JavaScript Quiz

Quiz
•
University
11 questions
Evaluación Diagnóstica Programación

Quiz
•
University
10 questions
Arduino TP02

Quiz
•
University
10 questions
Exercise 1 OOP

Quiz
•
University
10 questions
6CSN1

Quiz
•
University
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
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University