# Factors Program in Java

## Factor a number or algebraic expression that divides another number or expression evenly—i.e., with no remainder. For example, 3 and 6 are factors of 12 because 12 ÷ 3 = 4 exactly and 12 ÷ 6 = 2 exactly. The other factors of 12 are 1, 2, 4, and 12.

Factors of 12: 1, 2, 3, 4, 6, 8, 12.

```
import java.util.Scanner;
public class Factors
{
public static void main(String[] args)
{
int n;
Scanner sc = new Scanner(System.in);
System.out.print("Enter number=");
n = sc.nextInt();
for (int i = 1; i <= n; i++)
{
if (n % i == 0)
{
System.out.println(i);
}
}
}
}
```

#### Output:

Enter number=6 1 2 3 6b. tech. bca icse java java tutorials learn java mca programs

### Frequently Asked Questions

##### What is Factors Program?

Factor a number or algebraic expression that divides another number or expression evenly—i.e., with no remainder. For example, 3 and 6 are factors of 12 because 12 ÷ 3 = 4 exactly and 12 ÷ 6 = 2 exactly. The other factors of 12 are 1, 2, 4, and 12.
Factors of 12: 1, 2, 3, 4, 6, 8, 12.

##### What is Factors Program in Java?

Factor a number or algebraic expression that divides another number or expression evenly—i.e., with no remainder. For example, 3 and 6 are factors of 12 because 12 ÷ 3 = 4 exactly and 12 ÷ 6 = 2 exactly. The other factors of 12 are 1, 2, 4, and 12.
Factors of 12: 1, 2, 3, 4, 6, 8, 12.

**Recent Posts**

- Decimal to Binary Number Program in Java July 3, 2021
- Binary to Decimal Number Program in Java July 3, 2021
- Find biggest number from three given numbers Program in C July 2, 2021
- Find quotient and remainder Program in C July 2, 2021
- Print a message if negative number is entered Program in C July 2, 2021
- Print whether a number is even or odd Program in C July 2, 2021
- Print the bigger number Program in C July 2, 2021
- UP Board Class 6 Math अभ्यास - 4(e) सांख्यिकी June 29, 2021
- UP Board Class 6 Math अभ्यास - 4(d) सांख्यिकी June 29, 2021
- UP Board Class 6 Math अभ्यास - 4(c) सांख्यिकी June 29, 2021
- UP Board Class 6 Math अभ्यास - 4(b) सांख्यिकी June 29, 2021
- UP Board Class 6 Math अभ्यास - 4(a) सांख्यिकी June 29, 2021
- UP Board Class 6 Math अभ्यास - 3(f) पूर्णांक PART 2 June 27, 2021
- UP Board Class 6 Math अभ्यास - 3(f) पूर्णांक PART 1 2020 June 27, 2021
- UP Board Class 6 Math अभ्यास - 3(e) पूर्णांक 2020 June 27, 2021
- UP Board Class 6 Math अभ्यास - 3(d) पूर्णांक 2020 June 27, 2021
- UP Board Class 6 Math अभ्यास - 3(c) पूर्णांक 2020 June 27, 2021
- UP Board Class 6 Math अभ्यास - 3(b) पूर्णांक 2020 June 27, 2021
- UP Board Class 6 Math अभ्यास - 3(a) पूर्णांक June 27, 2021
- UP Board Class 6 Math अभ्यास - 2(d) पूर्ण संख्याएँ 2020 June 26, 2021