The printf() function on your platform does not support the %f formatter.
Asked
Active
Viewed 149 times
-5
-
4Hi, welcome to Puzzling. I don't, however, think this is a puzzle... – eye_am_groot Dec 20 '18 at 18:26
-
11I'm voting to close this question as off-topic because this appears to be a programming interview question. – rhsquared Dec 20 '18 at 18:28
-
So, either use another platform or another format. Or perhaps another printf. – Victor Stafusa - BozoNaCadeia Dec 21 '18 at 12:08
1 Answers
2
Well,
multiply the argument by 100
then
print it as an integer (%d)
and finally
insert a decimal separator before the second to last digit.
Glorfindel
- 28,033
- 9
- 96
- 142
-
6I think you may have just done some kid's homework assignment for them. – Admiral Jota Dec 20 '18 at 19:50