java-control structures-vlits

Quiz
•
Computers
•
1st Grade
•
Hard
kolla vivek
Used 47+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
do-while
while
for
none of the mentioned
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the data type that can be used with case statement in switch control structure?
The double data type.
The float data type.
The char data type.
The String data type.
3.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Which of the following will be the output of the above program?
public class Compute {
public static void main (string args [ ]){
int result, x ;
x = 1 ;
result = 0;
while (x < = 10) {
if (x%2 == 0)
result + = x ;
+ + x ;
}
System.out.println(result) ;
}
}
55
30
25
35
4.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
class Test {
public static void main(String[] args){
int i = 0, j = 9;
do {
i++;
if (j-- < i++) {
break;
}
} while (i < 5);
System.out.println(i + "" + j);
}
}
44
55
66
77
5.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
public class Test{
public static void main(String args[]){
int i = 0, j = 5 ;
for( ; (i < 3) && (j++ < 10) ; i++ ){
System.out.print(" " + i + " " + j );
}
System.out.print(" " + i + " " + j );
}
}
0 6 1 7 2 8 3 8
0 6 1 7 2 8 3 9
0 6 1 5 2 5 3 5
Compilation Error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
class Test{
public static void main(String args[]){
int x=7;
if(x==2); // Note the semicolon
System.out.println("NumberSeven");
System.out.println("NotSeven");
}
}
NumberSeven NotSeven
NumberSeven
NotSeven
Error
7.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
public class Test{
public static void main(String args[]){
int i, j;
for(i=1, j=0;i<10;i++) j += i;
System.out.println(i);
}
}
10
11
9
20
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Chapter1.1

Quiz
•
1st - 5th Grade
10 questions
Programming

Quiz
•
1st - 10th Grade
13 questions
Tutoria N7

Quiz
•
1st - 3rd Grade
10 questions
Introduction to Arrays

Quiz
•
KG - University
11 questions
Caligrafía | CM7

Quiz
•
1st - 10th Grade
10 questions
Pseudo Code

Quiz
•
1st - 3rd Grade
8 questions
Цикл whille

Quiz
•
1st - 5th Grade
8 questions
Robotics Quiz

Quiz
•
1st - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
18 questions
D189 1st Grade OG 1c Concept 37-38

Quiz
•
1st Grade
20 questions
addition

Quiz
•
1st - 3rd Grade
20 questions
Subject and predicate in sentences

Quiz
•
1st - 3rd Grade
20 questions
Addition and Subtraction facts

Quiz
•
1st - 3rd Grade
20 questions
Place Value

Quiz
•
KG - 3rd Grade
10 questions
Exploring Properties of Matter

Interactive video
•
1st - 5th Grade
5 questions
Life at a pond

Quiz
•
1st Grade
14 questions
Plural Nouns Adding s and es

Quiz
•
1st - 2nd Grade