Upcoming SlideShare
×

# การเขียนคำสั่งควบคุมขั้นพื้นฐาน

108 views

Published on

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
108
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
2
0
Likes
0
Embeds 0
No embeds

No notes for slide

### การเขียนคำสั่งควบคุมขั้นพื้นฐาน

1. 1. (cos) (Windows) BCLP B (Bell Laboratoorics) The C Programming Language 1988
2. 2. (Source Program) c work.c 2. (Compile) (Build) (Link) printf() .exe
4. 4. (Main Function) { } main( ) 2.3 1. { } main {} 2. 3. (:) 4. 1 1 1
6. 6. : data_type var data : var_type var name
7. 7. 1 ,
8. 8. input process output printf :
9. 9. : String _format %d Address_list & Ampersand : expreeion : var
10. 10. x y Printf “data x = “ scant “%&x : Printf “data = “ scant “%&y : 2. R = 2+3 * ; S= 2+3 * ; T= 2+3 * - ; Printf “ r=x+y*2=%dn”,r : Printf “ r= x+yX*2=5dn”,s : Printf “ r=x+y*2-1 =%dn”,t :
11. 11. 1 (char) 5.1 putchar ( ) 5.2 getchar ( ) 5.3 getch ( ) 5.4 getche ( ) 5. putcar ( ) 1 Putchar_argument
12. 12. 1. ‘A’ char word1 „1‟ word2 char word1=„A‟ , word2=„1‟ 2. 1 putchar(word1); putchar(word2); A1 5.2 getchar ( ) 1 Enter 1
13. 13. 1. Printf (“Key 1 Character=”) ; Word = getchar ( ) ; 1 a Enter char word 2. word a ( word) Printf (“You key Character is =%cn”,word) ; 5.3 getch ( ) 1 Enter 1 2 char_var
14. 14. 1. printf (“Key 1 Character =” ) ; word = getch ( ) ; 1 a Enter 2. word a ( word) printf (“Key 1 Character =%cn”,word ) ; char word
15. 15. 5.4 getche ( ) 1 Enter 1 2 char_var
16. 16. 1. printf (“Key 1 Character =” ) ; word = getcher ( ) ; 1 a Enter char word 2. word a word) printf (“Key 1 Character =%cn”,word ) ;
17. 17. (String) char[n] 6.1 puts() 1 string_argument
18. 18. 1. word Char word [15] = “*Example*”; 2. puts Puts (word) ; Puts (“*************”); 6.2 gets( ) Enter 1 2
19. 19. 1. Enter gets (word); 2. printf (You name is = %sn”,word) ;