import java.util.*;
public class Ch2Q22
{
public static void main(String[] args)
{Scanner kbd = new Scanner(System.in);
int no;
System.out.print("Enter the integer: ");
no = kbd.nextInt();
int i = 2;
while(no != 1)
if(no%i == 0)
{System.out.print(i+" "); no/=i;}
else i++;
}
}
No comments:
Post a Comment