Professional Documents
Culture Documents
FA23-BSE-004 (Lab 13)
FA23-BSE-004 (Lab 13)
import java.util.Scanner;
import java.io.*;
import java.util.*;
import java.io.*;
while (fileReader.hasNextInt()) {
values.add(fileReader.nextInt());
}
fileReader.close();
Collections.sort(values);
} catch (Exception e) {
System.out.println(e);
}
}
}
Task #03:
Write a Java program to accept all the data stored in a file in the previous task (Lab Task1).
Remove all the prime numbers from this data and save again in the same file.
import java.io.*;
import java.util.*;
try {
while (sc.hasNextInt()){
list.add(sc.nextInt());
if (!IsPrime(value)) {
unPrimedList.add(value);
}
}
System.out.println(integer);
System.out.println(e);
int check = 0;
if (number%i==0) check++;
return check != 1;