SlideShare ist ein Scribd-Unternehmen logo
1 von 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 การเขียนคำสั่งขั้นพื้นฐาน

Weitere ähnliche Inhalte

Was ist angesagt?

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 PathsOlivier Coudert
 
แก้ไขงานคอม1
แก้ไขงานคอม1แก้ไขงานคอม1
แก้ไขงานคอม1Ykk'Famemy Jackson
 
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 typesSourav Ganguly
 
Concept of scoping in programming languages
Concept of scoping in programming languagesConcept of scoping in programming languages
Concept of scoping in programming languagesMd. Jafar Sadik
 
Lecture 4 constants_variables
Lecture 4 constants_variablesLecture 4 constants_variables
Lecture 4 constants_variableseShikshak
 
Introduction to Vim, the text editor
Introduction to Vim, the text editorIntroduction to Vim, the text editor
Introduction to Vim, the text editorVysakh Sreenivasan
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentationnadim akber
 

Was ist angesagt? (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
 

Andere mochten auch

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

Andere mochten auch (6)

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

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

Ähnlich wie บทที่ 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
 
Cbasic
CbasicCbasic
Cbasic
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
 
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
 

Mehr von Nookky Anapat

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

Mehr von 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
 

Kürzlich hochgeladen

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 

Kürzlich hochgeladen (20)

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.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