Upcoming SlideShare
×

# Quiz01 and format specifier

619 views

Published on

for computer powerpoint 4th quarter

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
619
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
17
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Quiz01 and format specifier

1. 1. ARVIN Free Powerpoint Templates santos buendia
2. 2. OBJECTIVES <ul><li>Take Quiz 01 </li></ul><ul><li>Explain Format Specifier </li></ul><ul><li>Enumerate the Different Format Specifier in Turbo-C </li></ul><ul><li>Evaluate Format Specifier </li></ul>
3. 3. SCREEN OUTPUT AND ESCAPE SEQUENCE printf(“samahan mo akong pa-bloodn”); printf(“test… nnbaket???”); printf(“tnpara malaman nmo ikaw tang ”type ko””); samahan mo _ _ akong _ _ pa-blood _ _ test… _ _ _ baket??? _ _ _ para malaman _ _ mo ikaw _ _ ang _ “ type ko _ “ _ _
4. 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. 5. F ORMAT SPECIFIERS FORMAT SPECIFIER % c printf(“ charcater % cn ”, ‘a’); printf(“ character % c ”, ‘5’); FORMAT SPECIFIER FORMAT TYPE ARGUMENT LIST _ character _ a _ _ character _ 5 _
6. 6. F ORMAT SPECIFIERS FORMAT SPECIFIER % s printf(“ string is % sn ”, ” SUPERman ”  ); FORMAT SPECIFIER FORMAT TYPE ARGUMENT LIST _ string is _ SUPERman _ _
7. 7. F ORMAT SPECIFIERS FORMAT SPECIFIER % i or %d printf(“ integer % in ”, 5); printf(“ integer % d ”, 25); FORMAT SPECIFIER FORMAT TYPE ARGUMENT LIST _ integer _ 5 _ _ integer _ 25 _
8. 8. F ORMAT SPECIFIERS FORMAT SPECIFIER % f printf(“ float % fn ”, 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. 9. F ORMAT SPECIFIERS FORMAT SPECIFIER % % printf(“ Printing percent %%n ” ); FORMAT SPECIFIER FORMAT TYPE _ Printing percent _ % _ _
10. 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 n ”, 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. 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 _