SlideShare une entreprise Scribd logo
1  sur  21
Variable)
ASCII character (-
  char
             128
Unsigned
                     -
  char
   int      -
            -
  long
           3.4E-38         E+38
 Float

                1.7E-308
Double            E+308

Unsigned
   int
C

             Variable Declaration)

type name;
type :
name :
             C
                                 main
#include <stdio.h>
int num;                num
float y;            y
C


    C
A-Z     a-z
      Underscore)

                   A-Z
a-z   -




           Reserved Word)
C             ANSI Standard C)
       defa          regist        volatil
auto           float        struct         break
        ult            er            e
                                           doubl
 do     far return switch while case
                                              e
             typede                        signe
goto   short          char else      if
                  f                           d
unio                               unsig contin
       const enum int sizeof
  n                                 ned      ue
exter
      long static    void
  n
                            Borland C
C

      char
                        string


char name[n] = "str";
nam
e
n


str
C

C
C




        -
-
a>b a       b
a >= b a
            b
   a<b a        b
a <= b a
            b
    a == b a    b
x < 60 && x > 50         x


x == 10 || x == 15       x


x = 10 !x            x
-
C
         printf
            printf

                  int       float
string
%d

%u

%f

%c
printf

                              Hello
 printf("Hello
                  Program C
 Program C");

printf("Lampang             Lampang
  kunlayanee    kunlayanee school
    school");
                            Lampang
printf("Lampang
                  Thailand
   Thailand");
scanf
         C

 scanf
scanf()
scanf("format",&varia
ble);
forma
   t
         printf()



 varia
  ble
บทที่ 2 การเขียนคำสั่งขั้นพื้นฐาน

Contenu connexe

Tendances

แก้ไขงานคอม1
แก้ไขงานคอม1แก้ไขงานคอม1
แก้ไขงานคอม1
Ykk'Famemy Jackson
 

Tendances (12)

Void pointer in c
Void pointer in cVoid pointer in c
Void pointer in c
 
COSCUP: Foreign Function Call in Julia
COSCUP: Foreign Function Call in JuliaCOSCUP: Foreign Function Call in Julia
COSCUP: Foreign Function Call in Julia
 
An Efficient Algorithm to Verify Generalized False Paths
An Efficient Algorithm to Verify Generalized False PathsAn Efficient Algorithm to Verify Generalized False Paths
An Efficient Algorithm to Verify Generalized False Paths
 
แก้ไขงานคอม1
แก้ไขงานคอม1แก้ไขงานคอม1
แก้ไขงานคอม1
 
C programming language character set keywords constants variables data types
C programming language character set keywords constants variables data typesC programming language character set keywords constants variables data types
C programming language character set keywords constants variables data types
 
Vim For Php
Vim For PhpVim For Php
Vim For Php
 
week-7x
week-7xweek-7x
week-7x
 
Concept of scoping in programming languages
Concept of scoping in programming languagesConcept of scoping in programming languages
Concept of scoping in programming languages
 
Lecture 4 constants_variables
Lecture 4 constants_variablesLecture 4 constants_variables
Lecture 4 constants_variables
 
SLIME
SLIMESLIME
SLIME
 
Introduction to Vim, the text editor
Introduction to Vim, the text editorIntroduction to Vim, the text editor
Introduction to Vim, the text editor
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
 

En vedette (6)

งานย่อยที่ 1
งานย่อยที่ 1งานย่อยที่ 1
งานย่อยที่ 1
 
งานย่อยที่ 1
งานย่อยที่ 1งานย่อยที่ 1
งานย่อยที่ 1
 
พื้นฐานการเขียนโปรแกรม
พื้นฐานการเขียนโปรแกรมพื้นฐานการเขียนโปรแกรม
พื้นฐานการเขียนโปรแกรม
 
การเขียนฟังก์ชั่นในภาษา C
การเขียนฟังก์ชั่นในภาษา Cการเขียนฟังก์ชั่นในภาษา C
การเขียนฟังก์ชั่นในภาษา C
 
การเขียนคำสั่งควบคุมขั้นพื้นฐาน
การเขียนคำสั่งควบคุมขั้นพื้นฐานการเขียนคำสั่งควบคุมขั้นพื้นฐาน
การเขียนคำสั่งควบคุมขั้นพื้นฐาน
 
บทที่1 พื้นฐานโปรแกรมภาษาซี
บทที่1 พื้นฐานโปรแกรมภาษาซีบทที่1 พื้นฐานโปรแกรมภาษาซี
บทที่1 พื้นฐานโปรแกรมภาษาซี
 

Similaire à บทที่ 2 การเขียนคำสั่งขั้นพื้นฐาน

Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐาน
Krunee Thitthamon
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
princepavan
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
princepavan
 

Similaire à บทที่ 2 การเขียนคำสั่งขั้นพื้นฐาน (20)

Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Cbasic
CbasicCbasic
Cbasic
 
Cbasic
CbasicCbasic
Cbasic
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐาน
 
C++11
C++11C++11
C++11
 
2. introduction of a c program
2. introduction of a c program2. introduction of a c program
2. introduction of a c program
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
 
Cbasic
CbasicCbasic
Cbasic
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
 
Programming in C - interview questions.pdf
Programming in C - interview questions.pdfProgramming in C - interview questions.pdf
Programming in C - interview questions.pdf
 
C SLIDES PREPARED BY M V B REDDY
C SLIDES PREPARED BY  M V B REDDYC SLIDES PREPARED BY  M V B REDDY
C SLIDES PREPARED BY M V B REDDY
 
Syntax Comparison of Golang with C and Java - Mindbowser
Syntax Comparison of Golang with C and Java - MindbowserSyntax Comparison of Golang with C and Java - Mindbowser
Syntax Comparison of Golang with C and Java - Mindbowser
 
Paradigmas de Linguagens de Programacao - Aula #5
Paradigmas de Linguagens de Programacao - Aula #5Paradigmas de Linguagens de Programacao - Aula #5
Paradigmas de Linguagens de Programacao - Aula #5
 
C tutorial
C tutorialC tutorial
C tutorial
 
Basics of c
Basics of cBasics of c
Basics of c
 

Plus de Nookky Anapat

บทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรมบทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรม
Nookky Anapat
 
บทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรมบทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรม
Nookky Anapat
 
งานย่อย 1
งานย่อย 1งานย่อย 1
งานย่อย 1
Nookky Anapat
 
งานย อยท _ 1
งานย อยท _ 1งานย อยท _ 1
งานย อยท _ 1
Nookky Anapat
 
ข่าวไอที
ข่าวไอทีข่าวไอที
ข่าวไอที
Nookky Anapat
 
ข่าว It news
ข่าว It newsข่าว It news
ข่าว It news
Nookky Anapat
 
Acer iconia tab a700
Acer iconia tab a700Acer iconia tab a700
Acer iconia tab a700
Nookky Anapat
 
Acer iconia tab a700
Acer iconia tab a700Acer iconia tab a700
Acer iconia tab a700
Nookky Anapat
 

Plus de Nookky Anapat (18)

Andriod
AndriodAndriod
Andriod
 
Class1
Class1Class1
Class1
 
Class1
Class1Class1
Class1
 
บทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรมบทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรม
 
Class
ClassClass
Class
 
บทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรมบทที่ 6 คลาสและการเขียนโปรแกรม
บทที่ 6 คลาสและการเขียนโปรแกรม
 
Intel
IntelIntel
Intel
 
ข่าว It
ข่าว Itข่าว It
ข่าว It
 
งานย่อย 1
งานย่อย 1งานย่อย 1
งานย่อย 1
 
ข่าว It
ข่าว Itข่าว It
ข่าว It
 
งานย อยท _ 1
งานย อยท _ 1งานย อยท _ 1
งานย อยท _ 1
 
ข่าวไอที
ข่าวไอทีข่าวไอที
ข่าวไอที
 
It news (1)
It news (1)It news (1)
It news (1)
 
ข าว+It
ข าว+Itข าว+It
ข าว+It
 
ข่าว It news
ข่าว It newsข่าว It news
ข่าว It news
 
งาน It
งาน Itงาน It
งาน It
 
Acer iconia tab a700
Acer iconia tab a700Acer iconia tab a700
Acer iconia tab a700
 
Acer iconia tab a700
Acer iconia tab a700Acer iconia tab a700
Acer iconia tab a700
 

Dernier

Dernier (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

บทที่ 2 การเขียนคำสั่งขั้นพื้นฐาน

  • 1.
  • 3.
  • 4. ASCII character (- char 128 Unsigned - char int - - long 3.4E-38 E+38 Float 1.7E-308 Double E+308 Unsigned int
  • 5. C Variable Declaration) type name; type : name : C main
  • 6. #include <stdio.h> int num;  num float y;  y
  • 7. C C
  • 8. A-Z a-z Underscore) A-Z a-z - Reserved Word)
  • 9. C ANSI Standard C) defa regist volatil auto float struct break ult er e doubl do far return switch while case e typede signe goto short char else if f d unio unsig contin const enum int sizeof n ned ue exter long static void n Borland C
  • 10. C char string char name[n] = "str"; nam e n str
  • 11. C C
  • 12. C - -
  • 13. a>b a b a >= b a b a<b a b a <= b a b a == b a b
  • 14. x < 60 && x > 50 x x == 10 || x == 15 x x = 10 !x x
  • 15. -
  • 16. C printf printf int float string
  • 18. printf Hello printf("Hello Program C Program C"); printf("Lampang Lampang kunlayanee kunlayanee school school"); Lampang printf("Lampang Thailand Thailand");
  • 19. scanf C scanf