When I print a float number with "%f", it prints a float with 6 digits, but I don't want to print extra zeros. I can to use for example "%.3f" to print just 3 digits, but I want to print a float with number of random digits ,and using "%.{number}f" is not my answer. for example in:
#include <stdio.h>
int main()
{
    float a, b;
    printf("Please enter a number: ");
    scanf("%f", &a);
    printf("Please enter another number: ");
    scanf("%f", &b);
    printf("%f", a / b);
    return 0;
}
a/b can have even decimal digits. Of course, my question also applies to double and long double too.
 
     
    