The third section of the if statement should assign a new value to a variable (presumably f) during each iteration of the loop. Your statement within this section is valid which is why it compiles and runs, but since you don't ever change the value of f, the loop will run indefinitely. Perhaps you meant
I should give you the explanation of what was wrong.
I thought it was what Tetesuro mentioned but then found out that my book didn't mention %i in the beginning. It said to use %d even for integers.
The problem was (5/7). In C, whenever you get a decimal as a result of integer math any numbers to the right of the decimal point are dropped. So that makes "(5/7)" = "0" in integer math. Thus all my results came back as "0"