Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Java/CheckNoEvenOrNot.class
Binary file not shown.
12 changes: 12 additions & 0 deletions Java/CheckNoEvenOrNot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class CheckNoEvenOrNot {
public static void main(String[] args){
int a = 20;

if(a % 2 == 0){
System.out.println("Number is Even");
}else{
System.out.println("Number is odd");
}
}
}

Binary file added Java/CheckNoPrimeOrNot.class
Binary file not shown.
15 changes: 15 additions & 0 deletions Java/CheckNoPrimeOrNot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

public class CheckNoPrimeOrNot {
public static void main(String[] args) {
int a = 1;
// int temp = 0;

for(int i=2; i<=a/2; i++){
if(a%i==0){
System.out.println("Number Is Prime");
}else{
System.out.println("Number Is Not Prime");
}
}
}
}
Binary file added Java/FibonacciSeries.class
Binary file not shown.
17 changes: 17 additions & 0 deletions Java/FibonacciSeries.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
public class FibonacciSeries {
public static void main(String[] args){
int n1=0;
int n2=1;
int sum;
int count = 10;

System.out.print(n1+" ,"+n2);

for(int i=2; i<count; i++){
sum=n1+n2;
System.out.print(", "+sum);
n1=n2;
n2=sum;
}
}
}
Binary file added Java/SwapNoUsingArthOperator.class
Binary file not shown.
16 changes: 16 additions & 0 deletions Java/SwapNoUsingArthOperator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
public class SwapNoUsingArthOperator {
public static void main(String[] args) {
int a=10;
int b=20;

System.out.println("Before Swap" +a+ "," +b);

a = a^b; //30
b = a^b;
a = a^b;

System.out.println("After Swap" +a+ "," +b);


}
}
Binary file added Java/SwapTwoNo.class
Binary file not shown.
14 changes: 14 additions & 0 deletions Java/SwapTwoNo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class SwapTwoNo{
public static void main(String args[]) {
int a = 10;
int b = 20;
int temp;
System.out.println("Before Swap:" +a+ " , " +b);

temp = a;
a = b;
b=temp;

System.out.println("After Swap" +a+ ", " +b);
}
}
Binary file added Java/SwapTwoNoWithUsing3rdVariable.class
Binary file not shown.
13 changes: 13 additions & 0 deletions Java/SwapTwoNoWithUsing3rdVariable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public class SwapTwoNoWithUsing3rdVariable {
public static void main(String[] args) {
int a = 10;
int b = 20;
System.out.println("Before Swap:" +a+ " , " +b);

a = a+b; //30
b = a-b; //10
a = a-b; //20

System.out.println("After Swap:" +a+ " , "+b);
}
}
5 changes: 5 additions & 0 deletions Java/demo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class demo{
public static void main(String[] args){
System.out.println("Hello world java");
}
}