Skip to content

Commit

Permalink
My Commit After Adding Loop Control
Browse files Browse the repository at this point in the history
  • Loading branch information
kabysoft committed Aug 26, 2022
1 parent b40c04d commit 5ed1586
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.metadata/
18 changes: 18 additions & 0 deletions Mentoring/src/Hello_World/While_Loop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package Hello_World;

public class While_Loop {

public static void main(String[] args) {
// TODO Auto-generated method stub

int x = 10;

while( x < 20 ) {
System.out.print("value of x : " + x );
x++;
System.out.print("\n");
}

}

}
18 changes: 18 additions & 0 deletions Mentoring/src/Hello_World/do_while_loop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package Hello_World;

public class do_while_loop {

public static void main(String[] args) {
// TODO Auto-generated method stub

int x = 10;

do {
System.out.print("value of x : " + x );
x++;
System.out.print("\n");
}while( x < 20 );

}

}
13 changes: 13 additions & 0 deletions Mentoring/src/Hello_World/for_loop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package Hello_World;

public class for_loop {

public static void main(String[] args) {
// TODO Auto-generated method stub

for(int x = 10; x < 20; x = x + 1) {
System.out.print("value of x : " + x );
System.out.print("\n");
}
}
}
16 changes: 16 additions & 0 deletions Mentoring/src/Hello_World/logical_operators.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package Hello_World;

public class logical_operators {

public static void main(String[] args) {

boolean a = true;
boolean b = false;

System.out.println("a && b = " + (a&&b));
System.out.println("a || b = " + (a||b) );
System.out.println("!(a && b) = " + !(a && b));

}

}

0 comments on commit 5ed1586

Please sign in to comment.