## What is Common Factor of two numbers?

Common Factor is a number, that divides into the two numbers, leaving a remainder of zero for both numbers.

Both numbers implies “Common “

Remainder of zero implies “Factor”

## How to find all the Common Factors of two numbers?

For example, there are two numbers 48 and 72, we would like to find out all the common factors of these two numbers

48 = 2 * 2 * 2 * 2 * 3

72 = 2 * 2 * 2 * 3 * 3

The common part of 48 and 72 is 2* 2 * 2 * 3

so the common factor could be

if we pick 1 number: 2, 3

if we pick 2 numbers: 2*2 = 4, 2*3 = 6

if we pick 3 numbers: 2*2*2 = 8, 2*2*3 = 12

if we pick pick 4 numbers: 2*2*2*3 = 24

So all the common factors are: 2, 3, 4, 6, 8, 12 and 24, and the Greatest Common Factor is 24.

## Why need to find Greatest Common Factor?

Greatest Common Factor can be used to simplify a ratio. For example

48 / 72 = （2 * 24）/（3* 24） = 2 / 3

where 24 is the Greatest Common Factor.

## Array

int array = {0} //create an integer array contains 10 elements.