File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments