Everyone, I have a question. It is possible in C to print only values other than 0.
An Example:
-
We have output: 2.56000, 5.00000, 3.60000 and 27.36800
-
And I want you to print as follows: 2.56, 5, 3.6 and 27.368
But with printing running in a loop where I can only put
printf("%.2f \n");
or
printf("%f \n");
or
printf("%.1f \n");
or
printf("%.3f \n");
Can anyone help me?