C programming;Lesson 6: Operators for formatting the output
Special Signs for Surveillance:
constance meaning
\b movement for one place left \n new line \f new page \t horizontal tab \" quotation letter \\ backslash character
\? question mark
Example:
printf ("This is the first line. \n");
printf ("This is the second line");
printf ("\n \tThis is the third line and moved to the right");
Additional forms of variable formats:
The format "%2d" determines that the variable is a two-digit number.
Example:
int a;
scanf ("%2d", &a);
printf ("%d");
The format "% .2f" determines that the variable is a real number written in decimal form with two decimal places.
Example:
float a;
scanf ("%f", &a);
printf ("%.2f", a);
Nice article...
ReplyDeletelearn C with examples..
Basic C programming examples
C pattern programming examples
C Arrays examples
Loops in C examples
if-else in C with examples
Strings in C with examples