I have done a *Java program factor Program:
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.print("Enter the vaule"); int n=sc.nextInt(); for(int i=1;i<=n;i++){ if(n%i==0) { System.out.println(i+" "); } }}}