
Condition Statements -1
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
cgokul CELL-HICET
Used 1+ times
FREE Resource
Enhance your content in a minute
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
Determining System Requirements
Quiz
•
University
10 questions
CC 105 - Quiz 2 FINAL TERM
Quiz
•
University
10 questions
A level Computer Science In-fix post-fix Reverse polish
Quiz
•
10th Grade - University
10 questions
Cybersecurity Fundamentals Week 2 Quiz
Quiz
•
KG - University
10 questions
System ชื่อระบบเบื้องต้น
Quiz
•
University
10 questions
Fondos CSS3
Quiz
•
University
10 questions
Chapter 11 Quizz
Quiz
•
University
13 questions
Guess the Retro Computer 1
Quiz
•
KG - Professional Dev...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
