C Language Output special characters
The C language escape character is roughly the same as the preceding C # escape character, which lists the methods of C, output%d, \ n, and so on.
#include <stdio.h>intMain () {printf ("%%d");//output%d in the screenprintf ("\\n");//output in the screen \ nprintf ("%d");//0printf ("%%%%%d");//%%0printf ("%%%%d");//%%d return 0;}
About%f and%LF
%f and%lf are the float type and the double type are used to format the input and output corresponding to the format symbol.
which
Float, single-precision floating point, corresponds to%f.
Double, dual-precision floating point, corresponding to%LF.
The following program calculates and outputs a value of 500/3, leaving 3 decimal places in the result
#include <stdio.h>int main () { printf ("%.3lf\n",500.0 /3.0); // format symbol%.3LF means three decimal places reserved return 0 ;}
C Escape character