According to Newton's law of gravitation, the gravitational force is directly proportional to the product of their masses and inversely proportional to the square of the distance between their centers.
The magnitude of F is given as
Where
Force
Gravitational constant
Masses
Distance between masses