การเข ยนคำส _งควบค_มข__นพ__นฐาน (2)

  • 16 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
16
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. (cos) (Windows) BCLP B (Bell Laboratoorics) The C Programming Language 1988
  • 2. (Source Program) c work.c 2. (Compile) (Build) (Link) printf() .exe
  • 3. (Header File) main( ) h. #include<header_name> header_name printf #include <stdio.h>
  • 4. (Main Function) { } main( ) 2.3 1. { } main {} 2. 3. (:) 4. 1 1 1
  • 5. (identifier) (address)
  • 6. : data_type var data : var_type var name
  • 7. 1 ,
  • 8. input process output printf :
  • 9. : String _format %d Address_list & Ampersand : expreeion : var
  • 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. 1 (char) 5.1 putchar ( ) 5.2 getchar ( ) 5.3 getch ( ) 5.4 getche ( ) 5. putcar ( ) 1 Putchar_argument
  • 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. 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. 1. printf (“Key 1 Character =” ) ; word = getch ( ) ; 1 a Enter 2. word a ( word) printf (“Key 1 Character =%cn”,word ) ; char word
  • 15. 5.4 getche ( ) 1 Enter 1 2 char_var
  • 16. 1. printf (“Key 1 Character =” ) ; word = getcher ( ) ; 1 a Enter char word 2. word a word) printf (“Key 1 Character =%cn”,word ) ;
  • 17. (String) char[n] 6.1 puts() 1 string_argument
  • 18. 1. word Char word [15] = “*Example*”; 2. puts Puts (word) ; Puts (“*************”); 6.2 gets( ) Enter 1 2
  • 19. 1. Enter gets (word); 2. printf (You name is = %sn”,word) ;