Repository navigation
Expand file tree
/
Copy pathday12.java
More file actions
77 lines (70 loc) · 1.68 KB
/
Copy pathday12.java
File metadata and controls
77 lines (70 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package JHomeworks;
public class day12 {
public static void main(String[] args) {
// Which of these jump statements can skip processing remainder of code in its body for a particular iteration?
// a) break
// b) return
// c) exit
// d) continue ANSWER IS D
//
// What is the output of this 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);
// }
// a) 5
// b) 6 ANSWER IS B
// c) 14
// d) compilation error
//
// What is the output of this program?
//
// class jump_statements {
// public static void main(String args[])
// {
// int x = 2;
// int y = 0;
// for ( ; y < 10; ++y) {
// if (y % x == 0)
// continue;
// else if (y == 8)
// break;
// else
// System.out.print(y + " ");
// }
//// }
// }
// a) 1 3 5 7
// b) 2 4 6 8
// c) 1 3 5 7 9 ANSWER IS C
// d) 1 2 3 4 5 6 7 8 9
//
//
// What is the output of this 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");
//
//// }
// }
// a) Hello
// b) run time error
// c) Hello world
// d) compile time error answer is D
//
//
}
}