The correct format pattern for integers is %d, not %f!

http://www.cplusplus.com/reference/cstdio/printf/


Always learn from history, to be sure you make the same mistakes again...