Computer Science, asked by arshiad09, 2 months ago

Write a program in java
to enter a number and print its factors​

Answers

Answered by Anonymous
1

Answer:

You can find your Brainly profile link by clicking on your profile picture in the upper right corner. Once you click on your ...

Top answer ·

Answered by jamily92
1

import java.util.*;

public class Q3

{

   public static void main()

   {

       Scanner sc=new Scanner(System.in);

       System.out.println("Enter a number");

       int d,n;

       n=sc.nextInt();

       System.out.println("Enter a number");

       for(d=n; d>=1; d--)

       {

           if(n%d==0)

           System.out.println(d+"");

       }

   }

}Answer:

Explanation:

Similar questions