3. SCREEN OUTPUT AND ESCAPE SEQUENCE printf(“samahan mo akong pa-blood”); printf(“test… baket???”); printf(“para malaman mo ikaw ang type ko”); samahan mo _ _ akong _ _ pa-blood _ _ test… _ _ _ baket??? _ _ _ para malaman _ _ mo ikaw _ _ ang _ “ type ko _ “ _ _
4. F ORMAT SPECIFIERS F ORMAT SPECIFIERS start s with a percent sign % followed by a character that specified the format type printf(“ twenty five %d”, <argument list>) FORMAT SPECIFIERS %c a single character %s string of charcters %i or %d integer number %f floating point %% prints a percent sign FORMAT SPECIFIER FORMAT TYPE
5. F ORMAT SPECIFIERS FORMAT SPECIFIER % c printf(“ charcater % c ”, ‘a’); printf(“ character % c ”, ‘5’); FORMAT SPECIFIER FORMAT TYPE ARGUMENT LIST _ character _ a _ _ character _ 5 _
6. F ORMAT SPECIFIERS FORMAT SPECIFIER % s printf(“ string is % s ”, ” SUPERman ” ); FORMAT SPECIFIER FORMAT TYPE ARGUMENT LIST _ string is _ SUPERman _ _
7. F ORMAT SPECIFIERS FORMAT SPECIFIER % i or %d printf(“ integer % i ”, 5); printf(“ integer % d ”, 25); FORMAT SPECIFIER FORMAT TYPE ARGUMENT LIST _ integer _ 5 _ _ integer _ 25 _
8. F ORMAT SPECIFIERS FORMAT SPECIFIER % f printf(“ float % f ”, 5.3); printf(“ float with two decimal places % .2f ”, 5.345 ); FORMAT SPECIFIER FORMAT TYPE ARGUMENT LIST _ float _ 5.300000 _ _ float with two decimal places _ 5.35 _ NUMBER OF DECIMAL
9. F ORMAT SPECIFIERS FORMAT SPECIFIER % % printf(“ Printing percent %% ” ); FORMAT SPECIFIER FORMAT TYPE _ Printing percent _ % _ _
10. F ORMAT SPECIFIERS <argument list> contains exactly the same number of arguments as there are format specifiers , and the format specifiers and argument list are matched in order printf(“ Product of 5 and 25 is % i ”, 5 * 25 ); printf(“ Product of %d and %d is % i ” , 5, 25 , 5 * 25 ); _ Product of 5 and 25 is _ 125 _ _ Product of _ 5 _ and _ 25 _ is _ 125 _
11. F ORMAT SPECIFIERS If t he item of data type that does not directly correspond to the format specification , you will get unpredictable result printf(“ integer % f ”, 2); Abnormal program termination printf(“ My name is % d ”, ” ARVIN ” ); _ My name is _ 419 _