Write a program in java to accept a number from the user and print all the factors . Please answer this as fast as possible
Share
Write a program in java to accept a number from the user and print all the factors . Please answer this as fast as possible
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Hope this helps
Explanation:
package SimplerPrograms;
import java.util.Scanner;
public class FactorsOfNumberUsingFor {
private static Scanner sc;
public static void main(String[] args) {
int Number, i;
sc = new Scanner(System.in);
System.out.println("Please Enter any number to Find Factors: ");
Number = sc.nextInt();
for(i = 1; i <= Number; i++) {
if(Number%i == 0) {
System.out.format(" %d ", i);
}
}
}
}
Answer:
hey naina two papers left n sorry for late reply bunny n c my bio ok
BTW good night sweet dreams bunny
Saranghae bunny
luv u bunny
bye bye hey bunny don't reply me back ok bcoz I'm going offline bye bunny