|As well as the simple mechanics of the pause and the question over the formula, there is a classic C error in your program. You divide an int by an int and assign the result to a float:|
This will work, due to automatic type coercion, but will give an incorrect result - you will lose the fractional part of the result. The int will be divided by the int and produce an int result, which is then co-erced to a float. For example the code:
int i= 3, j = 4;
r = j/i;
produces the result r = 1.0000..., not r = 1.3333....
You need to cast the ints to floats (or just make them floats in the first place) before doing the division:
(Strictly speaking, the first cast would suffice, but it's more elegant to cast both the numerator and the denominator.)