write an algorithm to accept an integer number and print the factors of it
Answers
Answered by
1
import java.io.*;
public class project11
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
System.out.print("Enter: ");
int n= Integer.parseInt(br.readLine());
for(int i=1;i<=n;i++)
{
if(n%i==0)
{
System.out.println(i);
}
}
}
}
Bond54132:
i hope this helps you please mark it as the brainliest
Similar questions