#include <stdio.h>#include <stdlib.h>int main(){float a=123.456;printf("%f",a);return 0;}
不会输出末尾多余的0,如果需要的输出可以写成话printf("%.6f",a);