Skip to content

Commit 60c6804

Browse files
authored
Create Continuestmt.java
1 parent 5ce6de3 commit 60c6804

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

Continuestmt.java

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import java.util.Scanner;
2+
public class Continuestmt
3+
// {
4+
// public static void main(String[] args)
5+
// {
6+
// int n;
7+
// Scanner sc = new Scanner(System.in);
8+
// System.out.println("Enter the range: ");
9+
// n = sc.nextInt();
10+
// for(int i = 0; i <= n; i++)
11+
// {
12+
// if(i == 6)
13+
// {
14+
// continue;
15+
// }
16+
// System.out.println(i);
17+
// }
18+
// }
19+
// }
20+
21+
//########################### Continue Statement in While Loop ####################
22+
23+
24+
// {
25+
// public static void main(String[] args)
26+
// {
27+
// int i = 1;
28+
// while(i <= 10)
29+
// {
30+
// if(i == 9)
31+
// {
32+
// i++;
33+
// continue;
34+
// }
35+
// System.out.println(i);
36+
// i++;
37+
// }
38+
// }
39+
// }
40+
41+
42+
43+
//########################### Continue Statement in Do While Loop ####################
44+
45+
{
46+
public static void main(String[] args)
47+
{
48+
int i = 1;
49+
do
50+
{
51+
if(i == 7)
52+
{
53+
i++;
54+
continue;
55+
}
56+
System.out.println(i);
57+
i++;
58+
}while(i <= 20);
59+
}
60+
}

0 commit comments

Comments
 (0)