Section II data, types, and simple programs
First, common basic types
1, integer int long int (long)
(2 bytes) (8 bytes)
2, float float single-precision type
Double Dual Precision Type
3, character type (ASCII code) char
(integer type)
Example: int long double float
35L 2.5 2.5f
Scientific counting Method:
Example: 3+108 (2e8 (integer)) (scientific notation belongs to floating-point type)
int:
120 binary
O12 octal
ox12 Hex
Second, function printf and simple text output program
Format: printf (String)
"Formal parameters (formal parameter)"
printf ("Hello")
"Actual parameter (argument)"
Significance:
Sends a string to the display hardware.
PLACEHOLDER:
1,%d integer placeholders
2,%ld Long integer placeholders
3,%f decimal digit double-precision placeholder
4,%LF decimal digit long double precision placeholder
5,%e scientific counting method placeholder
6,%g computer according to choose%e or%f
7,%c character placeholder
8.%s String placeholder
Data and Simple Computing Program (2)