Created
September 17, 2019 05:38
-
-
Save markz0r/9a0fca5bccd6f47856dbd1c65dc9ec8f to your computer and use it in GitHub Desktop.
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
import java.util.Scanner; | |
public class PrFa { | |
public static void main(String args[]){ | |
int number; | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Enter a number ::"); | |
number = sc.nextInt(); | |
for(int i = 2; i< number; i++) { | |
while(number%i == 0) { | |
System.out.println(i+" "); | |
number = number/i; | |
} | |
} | |
if(number >2) { | |
System.out.println(number); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment