
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
Control Statements in JAVA

Quiz
•
University
14 questions
Java Operators

Quiz
•
University
10 questions
Talent Next Java MCQ-1

Quiz
•
University
11 questions
Array

Quiz
•
University
10 questions
Temel Java Bilgisi Ölçme Testi

Quiz
•
University
10 questions
java quiz on Encapsulation and Abstraction

Quiz
•
University
15 questions
Java Quiz set 3

Quiz
•
University
7 questions
Java Programming Game

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University