-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPractice_day_3_q_1.java
67 lines (67 loc) · 1.33 KB
/
Practice_day_3_q_1.java
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
public class Practice_day_3_q_1 {
public static void main(String[] args) {
int a=0;
if (a==0)
{
a+=1;
System.out.println("if block activated (from if) !");
}
if (a==0)
{
a+=1;
System.out.println("if block activated (from if else) !");
}
else
{
a+=1;
System.out.println("else block activated (from if else) !");
}
if (a==0)
{
a+=1;
System.out.println("if block activated (from if else) !");
}
else if (a==2)
{
a+=1;
System.out.println("else if block activated (from else if else) !");
}
while (a==3)
{ a+=1;
System.out.println("While block activated");
}
do
{
a+=1;
System.out.println("Do while block activated");
}while (a!=a);
for(a=a;a<=5;a++)
{
System.out.println("For block activated");
}
switch(a)
{
case 1:
System.out.println("Switch block , case 1 activated");
break;
case 2:
System.out.println("Switch block , case 2 activated");
break;
case 3:
System.out.println("Switch block , case 3 activated");
break;
case 4:
System.out.println("Switch block , case 4 activated");
break;
case 5:
System.out.println("Switch block , case 5 activated");
break;
case 6:
System.out.println("Switch block , case 6 activated");
break;
case 7:
System.out.println("Switch block , case 7 activated");
break;
}
}
}