If n is an integer, and 5 is an integer literal, the result is 5 / 4 without the floating-point part, that is, the result is 1.20 with the 0.20 part discarded - in other words, the result is 1. If you want the result to be 1.20, you can do this (note the use of 5.0 instead of 5):
or this:
or even this:
( double ) is a cast operator. It is being used to create a floating-point temporary copy of its operand, which is n or 5, depending on your choice.
Remember: in C, a division with both operands being integers results in an integer (this is called integer division, I think). You can follow one of the approaches I mentioned above so that when of the operands of / is a floating-point value, resulting in floating-point division.
Best,
stdq