@@ -0,0 +1,931 @@
+import java.util.ArrayList;%0Aimport java.util.Scanner;%0A%0A/**%0A * Created by Nathan_Zeplowitz on 4/11/15.%0A */%0Apublic class PrimeFactors %7B%0A    public static void main(String%5B%5D args) %7B%0A        PrimeFactors primeFactors = new PrimeFactors();%0A        Scanner in = new Scanner(System.in);%0A%0A        System.out.println(%22Enter a number%22);%0A        int n = in.nextInt();%0A        primeFactors.generate(n);%0A    %7D%0A%0A    private void generate(int n) %7B%0A        ArrayList%3CInteger%3E primeFactors = new ArrayList%3CInteger%3E();%0A        for (int i = 2; i %3C= n; i++) %7B%0A            while (n %25 i == 0) %7B%0A                primeFactors.add(i);%0A                n /= i;%0A            %7D%0A        %7D%0A        for (int i = 0; i %3C primeFactors.size(); i++) %7B%0A            if (i == primeFactors.size() - 1) %7B%0A                System.out.print(primeFactors.get(i));%0A            %7D else %7B%0A                System.out.print(primeFactors.get(i) + %22,%22);%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add Solution for Prime Factor Exercise