Use an operator to add two numbers. The Code is as follows:
Int main ()
{
Int a = 9;
Int B = 3;
Printf ("% d \ n", printf ("% * s", a, "", B ,""));
Return 0;
}
The result is as follows:
Http://ideone.com/YlBhO
Amazing!
The * operator in the printf function is used to specify the number of outputs. This value is specified by the first parameter after printf.
Therefore, printf ("% * s", a, "", B, "") can be divided into printf ("% * s", ,"") output a space. Similarly, printf ("% * s", B, "") Outputs B spaces. The advantage of this writing is that both a and B are variables, it can be modified externally.
Printf ("% * s", a, "", B, "") actually outputs a + B spaces, and 12 spaces here, the return value of printf is the total number of output characters, so the preceding statement output is
12
12 spaces plus 12 digits.
This is an excerpt from my blog