Octal output format hexadecimal (lowercase) hex (capital) of 8 to 15 and the output variable variable variable address 1.23456 default of two decimal places and the right alignment

. 1 # the include <stdio.h>
 2  
. 3  int main ()
 . 4  {
 . 5      unsigned Number;
 . 6      Double Item = 1.23456 ;
 . 7  
. 8      for (Number = . 8 ; Number < 16 ; ++ Number )
 . 9      {
 10          the printf ( " % O    " , Number);   / * octal output format Number * / 
. 11          the printf ( " % X    " , Number);   / * in hexadecimal format (lowercase) output Number * / 
12 is         the printf ( " % X-\ n- " , Number);    / * in hexadecimal format (uppercase) Output Number * / 
13 is      }
 14      the printf ( " \ n- " );
 15  
16      the printf ( " % P \ n-\ n- " , & item);   / * display variable item of address * / 
. 17  
18 is      the printf ( " % F \ n- " , item);
 . 19      the printf ( " % 8.2f \ n- " , item);   / * total field width of 8, the fractional part represents 2 * / 
20 is      the printf ( " % -8.2f\n", Item);   / * left justified output field (right alignment default) * / 
21 is      getchar ();
 22 is      return  0 ;
 23 is }

 

Guess you like

Origin www.cnblogs.com/liugangjiayou/p/11621079.html