Created
September 17, 2019 05:37
-
-
Save markz0r/e308510ecba2bb1fc816cedfeceb3efa 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