You need to replace your line number 7 with float. float n;
You defined 'n' as an integer and an int can not have decimal spaces. That is why your program was blowing up.
A float can have a decimal point so if you declare 'n' as a float, the compiler knows that it has to accept decimals.