#include <stdio.h>
/* line 1
* line 2
*/
int main () {
float pi = 3.1415926;
printf("%10s: %10.2f\n", "PI", pi);
printf("%-10s: %10.2f\n", "PI", pi);
printf("%10s: %010.2f\n", "PI", pi);
return 0;
}
Knowledge Points
%a.bf
a specifies width
b specifies the minimum number of digits to be written for integers, specifies the number of digits to be printed after the decimal point for float numbers