
QUIZ ON OPERATORS & CONTROL STATEMENTS

Quiz
•
Computers
•
University
•
Easy
Renugadevi Professor
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
a) do-while
b) while
c) for
d) none of the mentioned
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class selection_statements
{
public static void main(String args[])
{
int var1 = 5;
int var2 = 6;
if ((var2 = 1) == var1)
System.out.print(var2);
else
System.out.print(++var2);
}
}
1
2
3
4
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
. What will be the output of the following Java program?
class comma_operator
{
public static void main(String args[])
{
int sum = 0;
for (int i = 0, j = 0; i < 5 & j < 5; ++i, j = i + 1)
sum += i;
System.out.println(sum);
}
}
5
6
14
compialtion error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
final int a=10,b=20;
while(a<b)
{
System.out.println("Hello");
}
System.out.println("World");
}
}
Hello
run time error
Hello world
compile time error
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What would be the output of the following code snippet if variable a=10?
if(a<=0)
{
if(a==0)
{
System.out.println("1 ");
}
else
{
System.out.println("2 ");
}
}
System.out.println("3 ");
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is returned by “greater than”, “less than” and “equal to” operators?
Integers
Floating – point numbers
Boolean
None of the mentioned
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these operators can skip evaluating right hand operand?
a) !
a) !
b) |
c) &
d) &&
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Java Arrays

Quiz
•
University
10 questions
java operators

Quiz
•
University
10 questions
Inheritance

Quiz
•
University
15 questions
Java Programming

Quiz
•
University
9 questions
Java Programming Structures

Quiz
•
University
15 questions
Java Bootcamp Day 4

Quiz
•
University
15 questions
Round 4 - Harvest

Quiz
•
University
10 questions
Java Static

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade