Lets consider we have a double R = 99.999999;
(which may be obtained by a result of some other computation),now the desired output is 99.99
I tried using printf("%.2lf",R);
but it's rounding off the value.How to get the desired output ? (preferably using printf
)