Download to read offline
![Write a Java application that asks for an integer and returns its factorization into prime factors including their powers. The prime factors must appear in increasing order. For example if 120 (= 2*2*2*3*5) in the input number, then your program should output 120 = 2^3 * 3^1 * 5^1 The factors should appear in increasing order and should be separated from each other by asterisks (*). Solution import java.util.Scanner; public class factorialFactorization { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); System.out.print("Enter a number:"); int n = scan.nextInt(); int fact=1; for(int i=2;i<=n;i++) { fact = fact*i; } int count=0,hat=0; System.out.print(fact); System.out.print(" = "); for(int i=2;fact>1;i++) { count = 0; while(true) { if(fact%i==0) { count++; fact = fact/i;](https://image.slidesharecdn.com/writeajavaapplicationthatasksforanintegerandreturnsitsfac-230706230249-e50e4fb1/75/Write-a-Java-application-that-asks-for-an-integer-and-returns-its-fac-pdf-1-2048.jpg)

The document provides a description and code for a Java application that factors an input integer into its prime factors and displays them in increasing order along with their powers. The example given shows how the input of 120 is factored into 2^3, 3^1, and 5^1. The code utilizes a scanner for input and loops to determine factors and their counts.
![Write a Java application that asks for an integer and returns its factorization into prime factors including their powers. The prime factors must appear in increasing order. For example if 120 (= 2*2*2*3*5) in the input number, then your program should output 120 = 2^3 * 3^1 * 5^1 The factors should appear in increasing order and should be separated from each other by asterisks (*). Solution import java.util.Scanner; public class factorialFactorization { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); System.out.print("Enter a number:"); int n = scan.nextInt(); int fact=1; for(int i=2;i<=n;i++) { fact = fact*i; } int count=0,hat=0; System.out.print(fact); System.out.print(" = "); for(int i=2;fact>1;i++) { count = 0; while(true) { if(fact%i==0) { count++; fact = fact/i;](https://image.slidesharecdn.com/writeajavaapplicationthatasksforanintegerandreturnsitsfac-230706230249-e50e4fb1/75/Write-a-Java-application-that-asks-for-an-integer-and-returns-its-fac-pdf-1-2048.jpg)
