#include #include int main() { float pi=3.1415; printf("|% 20.7f|\n", pi); // the space leaves a space for the sign printf("|% -20.7f|\n", -pi); // the space leaves a space for the sign printf("|% -20.7f|\n", pi); // the - is for "left justify" printf("\n"); printf("|%-20.7f|\n", pi); printf("|%-20.7f|\n", -pi); // no space was left for the sign so the formattinf is off system("pause"); return 0; }