+ 1

In c while using float datatype a default number is showing at last.how to remove it?

For example if the required answer is 10.24 then it is showing 10.240001 why this is happening how to remove that 1.

15th Oct 2020, 12:01 PM
rohit
2 Answers
15th Oct 2020, 12:20 PM
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż - avatar
0
here: #include <stdio.h> int main() { float a = 10.24f; printf("%.2f", a); return 0; } https://code.sololearn.com/c4PgRNBZ0m1O/?ref=app
15th Oct 2020, 12:21 PM
Flash