See More

//Program to print Prime numbers from the given array of elements. import java.util.Scanner; public class PrimesFromArray { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter the number of elements in the array: "); int n=scanner.nextInt(); int[] arr = new int[n]; System.out.println("Enter the elements of the array: "); for (int i=0; i