Q:

numbers behind % in printf and scanf

I stumbled into this and I don't know what it does exactly
int i; 
for ( i = 1; i <= 20; i++ ) {
  printf( "%10d", (1+rand()%6) );

  if ( i % 5 == 0 ) {
    printf( "\n" );
  } 
} 

Above is part of a program that tosses a dice for 20 times.
The thing i don't understand is this line:
printf( "%10d", (1+rand()%6) );

My problem is "%10d"
Is this a visual thing because outputs order of appearance change with it.
I know in float values it shows decimal point but what about in integers as int, also can anyone tell me the difference between this:
prinf("%.2f",value);

and this:
prinf("%6.2f",value);

They both print 1000.30, so what is 6 for?

A:

"%10d" means to pad with spaces on the left, as needed, so decimal output is at least 10 characters.

