-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef206db
commit be987ca
Showing
274 changed files
with
8,937 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
32 changes: 32 additions & 0 deletions
32
.metadata/.plugins/org.eclipse.core.resources/.history/0/70f956638871001f137e877e162b9394
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub4 | ||
System.out.println("Enter the size of array:\n"); | ||
Scanner sc=new Scanner(System.in); | ||
int n=sc.nextInt(); | ||
int arr1[]=new int[n]; | ||
int arr2[]=new int[n]; | ||
int sum[]=new int[n]; | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the first array:\n"); | ||
arr1[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the second array:\n"); | ||
arr2[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
sum[i]=arr1[i]+arr2[i]; | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("sum of total array:\n"+" "+sum); | ||
} | ||
|
||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
.metadata/.plugins/org.eclipse.core.resources/.history/10/10f098b28c72001f1e968e55e34ad9ff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.nit.core; | ||
|
||
public class Armstrong { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
.metadata/.plugins/org.eclipse.core.resources/.history/10/705bb8049172001f1e968e55e34ad9ff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class Armstrong { | ||
|
||
public static void main(String[] args) { | ||
Scanner sc=new Scanner(System.in); | ||
System.out.print("Enter a number: "); | ||
int number = sc.nextInt(); | ||
if (isArmstrong(number)) { | ||
System.out.println(number + " is an Armstrong number."); | ||
} else { | ||
System.out.println(number + " is not an Armstrong number."); | ||
} | ||
|
||
} | ||
public static boolean isArmstrong(int number) { | ||
int originalNumber = number; | ||
int numberOfDigits = String.valueOf(number).length(); | ||
int sum = 0; | ||
|
||
while (number > 0) { | ||
int digit = number % 10; | ||
sum += Math.pow(digit, numberOfDigits); | ||
number /= 10; | ||
} | ||
return sum == originalNumber; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
.metadata/.plugins/org.eclipse.core.resources/.history/11/3022bb70e96f001f1817ae0e100a7d43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class ForLoop { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub | ||
int i, j; int num; | ||
Scanner sc=new Scanner(System.in); | ||
System.out.println("Enter a number\n"); | ||
num= sc.nextInt(); | ||
for(i=1; i<=10; i++) { | ||
System.out.println(num+"*"+i+"="+ num*i); | ||
|
||
} | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
.metadata/.plugins/org.eclipse.core.resources/.history/11/40f1e8ee8471001f137e877e162b9394
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.nit.core; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
.metadata/.plugins/org.eclipse.core.resources/.history/11/f01ceef3c171001f15afaca8b4bcce42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub4 | ||
System.out.println("Enter the size of array:\n"); | ||
Scanner sc=new Scanner(System.in); | ||
int n=sc.nextInt(); | ||
int arr1[]=new int[n]; | ||
int arr2[]=new int[n]; | ||
int sum[]=new int[n]; | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the first array:\n"); | ||
arr1[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the second array:\n"); | ||
arr2[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
sum[i]=arr1[i]+arr2[i]; | ||
System.out.println("sum of array:\n"+" "+sum[i]); | ||
} | ||
|
||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
.metadata/.plugins/org.eclipse.core.resources/.history/12/903584f61b71001f1384d0532bcf5f24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofArray { | ||
|
||
public static void main(String[] args) { | ||
int a; | ||
// TODO Auto-generated method stub | ||
Scanner sc= new Scanner(System.in); | ||
a[]=sc.nextInt(); | ||
|
||
} | ||
|
||
} |
Empty file.
16 changes: 16 additions & 0 deletions
16
.metadata/.plugins/org.eclipse.core.resources/.history/17/607fce9b5470001f13efb6132910ec6a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumSeriesInputByUser { | ||
public static void main(String[] args) { | ||
double sum=0.0; int n; | ||
System.out.println("Enter a number"); | ||
Scanner sc=new Scanner(System.in); | ||
n=sc.nextInt(); | ||
for(int i=1; i>n; i++) { | ||
sum=sum+i; | ||
System.out.println(+sum); | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
.metadata/.plugins/org.eclipse.core.resources/.history/1a/b0d2dc865370001f13efb6132910ec6a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.nit.core; | ||
|
||
public class SumSeriesInputByUser { | ||
public static void main(String[] args) { | ||
for(int i=1; i<=n; i++) { | ||
sum=+i; | ||
System.out.println(+sum); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
.metadata/.plugins/org.eclipse.core.resources/.history/1c/00c06b36c271001f15afaca8b4bcce42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub4 | ||
int sum=0; | ||
System.out.println("Enter the size of array:\n"); | ||
Scanner sc=new Scanner(System.in); | ||
int n=sc.nextInt(); | ||
int arr1[]=new int[n]; | ||
int arr2[]=new int[n]; | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the first array:\n"); | ||
arr1[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the second array:\n"); | ||
arr2[i]=sc.nextInt(); | ||
} | ||
|
||
for(int i=0; i<n; i++) { | ||
sum[i]=arr1[i]+arr2[i]; | ||
|
||
System.out.println(sum[i]); | ||
} | ||
|
||
} | ||
|
||
} |
Empty file.
32 changes: 32 additions & 0 deletions
32
.metadata/.plugins/org.eclipse.core.resources/.history/1d/405451748971001f137e877e162b9394
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub4 | ||
System.out.println("Enter the size of array:\n"); | ||
Scanner sc=new Scanner(System.in); | ||
int n=sc.nextInt(); | ||
int arr1[]=new int[n]; | ||
int arr2[]=new int[n]; | ||
int sum[]=new int[n]; | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the first array:\n"); | ||
arr1[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the second array:\n"); | ||
arr2[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
sum[i]=arr1[i]+arr2[i]; | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("sum of total array:\n"+" "+sum[i]); | ||
} | ||
|
||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
.metadata/.plugins/org.eclipse.core.resources/.history/24/b0272403f06f001f1817ae0e100a7d43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class PrimeNumber { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub | ||
int n, i; | ||
System.out.println("Enter a number\n"); | ||
Scanner sc= new Scanner(System.in); | ||
n=sc.nextInt(); | ||
if(checkPrime(n)) { | ||
System.out.println(+n +"number is prime"); | ||
} | ||
else { | ||
System.out.println(+n +"number is not prime" ); | ||
} | ||
} | ||
|
||
private static boolean checkPrime(int n) { | ||
// TODO Auto-generated method stub | ||
if(n<=1) { | ||
return false; | ||
} | ||
for(i=2; i < Math.sqrt(n); i++) { | ||
if(n%i==0) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
.metadata/.plugins/org.eclipse.core.resources/.history/25/106aaddd5770001f13efb6132910ec6a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.nit.core; | ||
|
||
public class ReverseNumber { | ||
public static void main(String[] args) { | ||
|
||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
.metadata/.plugins/org.eclipse.core.resources/.history/26/3087bf868671001f137e877e162b9394
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub4 | ||
System.out.println("Enter the size of array:\n"); | ||
Scanner sc=new Scanner(System.in); | ||
int n=sc.nextInt(); | ||
int arr1[]=new int[n]; | ||
int arr2[]=new int[n]; | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the first array:\n"); | ||
arr1[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the second array:\n"); | ||
arr2[i]=sc.nextInt(); | ||
} | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
.metadata/.plugins/org.eclipse.core.resources/.history/28/702cc2fbc471001f15afaca8b4bcce42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub4 | ||
System.out.println("Enter the size of array:\n"); | ||
Scanner sc=new Scanner(System.in); | ||
int n=sc.nextInt(); | ||
int arr1[]=new int[n]; | ||
int arr2[]=new int[n]; | ||
int sum[]=new int[n]; | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the first array:\n"); | ||
arr1[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the second array:\n"); | ||
arr2[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
sum[i]=(arr1[i]+arr2[i]); | ||
System.out.println("sum of array:\n"+" "+sum); | ||
} | ||
|
||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
.metadata/.plugins/org.eclipse.core.resources/.history/28/a0a98b0fc271001f15afaca8b4bcce42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.nit.core; | ||
|
||
import java.util.Scanner; | ||
|
||
public class SumofTwoArray { | ||
|
||
public static void main(String[] args) { | ||
// TODO Auto-generated method stub4 | ||
System.out.println("Enter the size of array:\n"); | ||
Scanner sc=new Scanner(System.in); | ||
int n=sc.nextInt(); | ||
int arr1[]=new int[n]; | ||
int arr2[]=new int[n]; | ||
int sum[]=new int[n]; | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the first array:\n"); | ||
arr1[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
System.out.println("Enter the second array:\n"); | ||
arr2[i]=sc.nextInt(); | ||
} | ||
for(int i=0; i<n; i++) { | ||
sum[i]=arr1[i]; | ||
sum[i]=arr2[i]; | ||
System.out.println("sum of array:\n"+" "+sum[i]); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.