This commit is contained in:
hesham 2019-03-01 17:01:29 +03:00
parent bb8ed4c47f
commit 4712848bf1
6 changed files with 89 additions and 0 deletions

12
src/lab/six/Five.java Normal file
View File

@ -0,0 +1,12 @@
package lab.six;
public class Five {
public static void main(String []args){
for (int i = 1; i<= 10; i++){
if (i < 6){
System.out.println(i);
}
else break;
}
}
}

15
src/lab/six/Four.java Normal file
View File

@ -0,0 +1,15 @@
package lab.six;
public class Four {
public static void main(String []args){
int i = 1;
int sum = 0;
while (i <= 10 ){
if (i != 3 && i != 6){
sum += i;
}
i++;
}
System.out.println(sum);
}
}

11
src/lab/six/One.java Normal file
View File

@ -0,0 +1,11 @@
package lab.six;
public class One {
public static void main(String [] args){
for (int i = 1; i<= 100; i++){
if (i % 2 != 0){
System.out.println(i);
}
}
}
}

12
src/lab/six/Six.java Normal file
View File

@ -0,0 +1,12 @@
package lab.six;
public class Six {
public static void main(String []args){
for (int i = 1; i<= 10; i++){
if (i == 6){
continue;
}
else System.out.println(i);;
}
}
}

25
src/lab/six/Three.java Normal file
View File

@ -0,0 +1,25 @@
package lab.six;
public class Three {
public static void main(String []args){
for (int i = 1; i <= 5; i++){
switch (i){
case 1:
System.out.println("A");
break;
case 2:
System.out.println("B");
break;
case 3 :
System.out.println("C");
break;
case 4 :
System.out.println("D");
break;
case 5:
System.out.println("E");
break;
}
}
}
}

14
src/lab/six/Two.java Normal file
View File

@ -0,0 +1,14 @@
package lab.six;
public class Two {
public static void main(String []args){
int i = 10;
do {
System.out.println(i);
i--;
} while (i >= 0);
}
}