1. When characters are to be output to output devices (display screen, printer, etc.). ), which can be controlled by C format descriptors. The following code is the output character ch (a): charch =' a'; printf("Character: %c \n ",ch);
2. When the decimal number needs to be output, you can use D or I to control the output, as shown in the following figure: int dcm = 24printf ("decimal number: %d\n", DCM); Printf ("decimal number: %i\n", DCM);
3. The octal output is as follows. Use o or #o to control the number output in octal format: int oct = 24 printf ("octol1:%o \ n", oct); printf("Octal2: %#o\n ",oct);
4. The hexadecimal output is the same as the octal output. Using x or #x, you can output numbers that control hexadecimal format, as shown below: Inthexi = 234printf ("hexidecimal1:%x \ n", Hexi); Printf("Hexidecimal2: %#x\n ",Hexi);
5, string output, in C language, the output string can be controlled by S.