Home Java Loops

Loops

7 min read
0
0
162

In Java Consist of 3 Loops.

1.for loop

2.while loop

3.do while loop

for loop

Output

1
2
3
4
5
6
7
8
9

While loop

Output

1
2
3
4
5
6
7
8
9
10

Do while Loop

Output

0
1
2
3
4
5
6
7
8
9

Exercises

Output

1
4
9
16
25
36
49
64
81

Output

12
18
28
42
60
82
108
138
172

Output

2
4
6
8
10
12
14
16
18

Output

1
8
27
64
125
216
343
512
729

Output

1
0
3
16
45
96
175
288

Output

10
20
30
40
50
60
70
80
90
100

Output

-10
-20
-30
-40
-50
-60
-70
-80
-90
-100

Output

******
6
******
12
******
20
******
30
******
42
******
56
******
72
******
90
******
110

Output

x= 4
y= 2
z= 1
x= 3
y= 1
z= 0
x= 2
y= 0
z= -1
x= 1
y= -1
z= -2

Output

3
5
7
9
11
13
15
17
19

break Keyword

Output

1
2
3
4
5

Output

3
5

Output

1
0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10

Continue Keyword

Output

1
2
4
5
6
7
8
9

Output

5
6
8
9

Load More Related Articles
Load More By admin
Load More In Java

Leave a Reply

Your email address will not be published.

Check Also

Node js React Mongodb Search Functionality

In this articles will teach how to search records Node js React Express Mongodb.how the se…