Given Program is very straightforward .The only logic here is:
f-=.2;
The above statement will be interpreted as
$f=f-.2;$
Here the for loop is executive five times ,and each time the value of f is decremted by $.2$.
So output will be :
Now the question is asking What will be the value of $f$ after the execution of following program
So final value of $f$ is $9$.
Why not option C?
%$g$ is for It's there only to remove the trailing zeroes, otherwise it does the same thing as %$f$ or %$e$ (both of which are much more common).
%$g$ specifies the shortest representation of %$e$ or %$f$.
So option B is correct.