SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
5             2553                                                                        -   ....................................................................
                                                                                 40203
                                           F                    (                            F )                                                5
                                                     F       printf() scanf()
   F             F             F F                                 F                         F                     F
            1               F 0508531.CPP
#include <stdio.h>
#include <conio.h>
main()                                                                                                       F         F
   {
        int score1,score2,score3,score4,score5;                                                      F               F
        int scoretotal;                             F         F
        float scoreave;                               F         F
        scoretotal = 0;                     F 0 F            scoretotal
        scoreave = 0;                        F 0 F           scoreave
        printf( Please input number score 1 = );                                          F        Please input number score 1 =
        scanf( %d ,&score1);                                                            F                  F F                    score1
        printf( Please input number score 2 = );                                      F            Please input number score 2 =
        scanf( %d ,&score2);                                                        F                     F F                    score2
        printf( Please input number score 3 = );                              F                   Please input number score 3 =
        scanf( %d ,&score3);                                            F                              F F                       score3
        printf( Please input number score 4 = );                                F                  Please input number score 4 =
        scanf( %d ,&score4);                                              F                             F F                      score4
        printf( Please input number score 5 = );                                  F                Please input number score 5 =
        scanf( %d ,&score5);                                                F                            F F                     score1
        printf( This is Total score : %d n ,scoretotal);             F                        This is Total score :       F            scoretotal
        scoretotal = score1 + score2 + score3 + score4 + score5;                            F                            F          F       scoretotal
        scoreave = scoretotal/5;                                  F                            scoretotal       F 5 F        F         scoreave
        printf( This is Average score : %f ,scoreave);              F                         This is Average score :          F          scoreave
        getch();                     F F 1
   }




                                                                                                                       F
5        2553                                               -   ....................................................................
            2         F 0508532.CPP
#include <stdio.h>
#include <conio.h>
main()                                                                         F                         F
   {
        char name[15],surname[20];
        int age;
        float gpascore;
        printf("Please input your name = " );                                                                                  .....
        scanf("%s",&name);                                                                                                         ..
        printf("Please input your surname = " );                                                                                   .
        scanf("%s",&surname);                                                                                                       .
        printf("Please input your age = " );                                                                                      ..
        scanf("%d",&age);                                                                                                           .
        printf("Please input your gpa score = " );                                                                                    .
        scanf("%f",&gpascore);                                                                                                      .
        printf("Name : %s Surname : %s n",name,surname);
        printf("Age : %d n",age);                                                                                                  ..
        printf("GPA score : %.2f ",gpascore);
        getch();
    }

                                                            F

Contenu connexe

Tendances

Ma4 set-u-s54
Ma4 set-u-s54Ma4 set-u-s54
Ma4 set-u-s54Koku Love
 
Forum2009 Sm Grp Disc Summary 0014
Forum2009 Sm Grp Disc Summary 0014Forum2009 Sm Grp Disc Summary 0014
Forum2009 Sm Grp Disc Summary 0014Tom Loughran
 
13 แสง
13 แสง13 แสง
13 แสงtopofzeed
 
Python variables datatypes
Python variables datatypesPython variables datatypes
Python variables datatypesradhikaadroja
 
Lvb Sonate 10no1 1 Let
Lvb Sonate 10no1 1 LetLvb Sonate 10no1 1 Let
Lvb Sonate 10no1 1 Letguest2dde99
 
miniLesson on the printf() function
miniLesson on the printf() functionminiLesson on the printf() function
miniLesson on the printf() functionChristine Wolfe
 
An Expressive Model for Instance Decomposition Based Parallel SAT Solvers
An Expressive Model for Instance Decomposition Based Parallel SAT SolversAn Expressive Model for Instance Decomposition Based Parallel SAT Solvers
An Expressive Model for Instance Decomposition Based Parallel SAT SolversTobias Philipp
 
รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผล
 รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผล รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผล
รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผลsurachai chai
 
industrial Technology Assistance Program: iTAP
industrial Technology Assistance Program: iTAPindustrial Technology Assistance Program: iTAP
industrial Technology Assistance Program: iTAPNstdaAcademy Nstda
 
10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unixchinkshady
 
Kopprasch 60 selected studies for bb flat tuba
Kopprasch 60 selected studies for bb flat tubaKopprasch 60 selected studies for bb flat tuba
Kopprasch 60 selected studies for bb flat tubahanktuba
 

Tendances (19)

Ma4 set-u-s54
Ma4 set-u-s54Ma4 set-u-s54
Ma4 set-u-s54
 
ชนิดข้อมูลและตัวแปร
ชนิดข้อมูลและตัวแปรชนิดข้อมูลและตัวแปร
ชนิดข้อมูลและตัวแปร
 
Forum2009 Sm Grp Disc Summary 0014
Forum2009 Sm Grp Disc Summary 0014Forum2009 Sm Grp Disc Summary 0014
Forum2009 Sm Grp Disc Summary 0014
 
13 แสง
13 แสง13 แสง
13 แสง
 
Eecs 317 20010209
Eecs 317 20010209Eecs 317 20010209
Eecs 317 20010209
 
CHAPTER 4
CHAPTER 4CHAPTER 4
CHAPTER 4
 
Python variables datatypes
Python variables datatypesPython variables datatypes
Python variables datatypes
 
Lvb Sonate 10no1 1 Let
Lvb Sonate 10no1 1 LetLvb Sonate 10no1 1 Let
Lvb Sonate 10no1 1 Let
 
ฟังก์ชัน Printf&scanf
ฟังก์ชัน Printf&scanfฟังก์ชัน Printf&scanf
ฟังก์ชัน Printf&scanf
 
K cyber invest-user manual th
K cyber invest-user manual thK cyber invest-user manual th
K cyber invest-user manual th
 
4. loop
4. loop4. loop
4. loop
 
miniLesson on the printf() function
miniLesson on the printf() functionminiLesson on the printf() function
miniLesson on the printf() function
 
จิตอาสา
จิตอาสาจิตอาสา
จิตอาสา
 
An Expressive Model for Instance Decomposition Based Parallel SAT Solvers
An Expressive Model for Instance Decomposition Based Parallel SAT SolversAn Expressive Model for Instance Decomposition Based Parallel SAT Solvers
An Expressive Model for Instance Decomposition Based Parallel SAT Solvers
 
รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผล
 รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผล รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผล
รับมือไข้หวัดใหญ ่ สายพันธุ์ใหม่ 2009 แบบ บ้านๆ แต่ได้ผล
 
industrial Technology Assistance Program: iTAP
industrial Technology Assistance Program: iTAPindustrial Technology Assistance Program: iTAP
industrial Technology Assistance Program: iTAP
 
Bottomupparser
BottomupparserBottomupparser
Bottomupparser
 
10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix
 
Kopprasch 60 selected studies for bb flat tuba
Kopprasch 60 selected studies for bb flat tubaKopprasch 60 selected studies for bb flat tuba
Kopprasch 60 selected studies for bb flat tuba
 

Similaire à เขียนโปรแกรมใช้คำสั่ง Printf scanf

บทที่ 6 1 ฟังก์ชัน printf scanf [slide]
บทที่ 6 1 ฟังก์ชัน printf scanf [slide]บทที่ 6 1 ฟังก์ชัน printf scanf [slide]
บทที่ 6 1 ฟังก์ชัน printf scanf [slide]Nattapon
 
แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2
แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2
แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2อานนท์ มากมี
 
ใบความรู้เรื่องคำสั่ง Printf scanf
ใบความรู้เรื่องคำสั่ง Printf scanfใบความรู้เรื่องคำสั่ง Printf scanf
ใบความรู้เรื่องคำสั่ง Printf scanfธงชัย พาศรี
 
2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io웅식 전
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซีkramsri
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซีkramsri
 
Questions typedef and macros
Questions typedef and macrosQuestions typedef and macros
Questions typedef and macrosMohammed Sikander
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY MazedurMazedurr rahman
 
C programs Set 4
C programs Set 4C programs Set 4
C programs Set 4Koshy Geoji
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐานKrunee Thitthamon
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdfmhande899
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C LanguageRAJWANT KAUR
 

Similaire à เขียนโปรแกรมใช้คำสั่ง Printf scanf (20)

บทที่ 6 1 ฟังก์ชัน printf scanf [slide]
บทที่ 6 1 ฟังก์ชัน printf scanf [slide]บทที่ 6 1 ฟังก์ชัน printf scanf [slide]
บทที่ 6 1 ฟังก์ชัน printf scanf [slide]
 
แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2
แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2
แบบฝึกทักษะการเขียนโปรแกรมภาษาซีเล่ม2
 
ใบความรู้เรื่องคำสั่ง Printf scanf
ใบความรู้เรื่องคำสั่ง Printf scanfใบความรู้เรื่องคำสั่ง Printf scanf
ใบความรู้เรื่องคำสั่ง Printf scanf
 
2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io
 
9.C Programming
9.C Programming9.C Programming
9.C Programming
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
Questions typedef and macros
Questions typedef and macrosQuestions typedef and macros
Questions typedef and macros
 
pointers 1
pointers 1pointers 1
pointers 1
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY Mazedur
 
C programs Set 4
C programs Set 4C programs Set 4
C programs Set 4
 
Input And Output
 Input And Output Input And Output
Input And Output
 
iit c prog.ppt
iit c prog.pptiit c prog.ppt
iit c prog.ppt
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐาน
 
C
CC
C
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdf
 
Unit2 C
Unit2 CUnit2 C
Unit2 C
 
Unit2 C
Unit2 C Unit2 C
Unit2 C
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
Pointers
PointersPointers
Pointers
 

Plus de ธงชัย พาศรี

ใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรมใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรมธงชัย พาศรี
 
เขียนโปรแกรมใช้คำสั่ง Printf scanf
เขียนโปรแกรมใช้คำสั่ง  Printf scanfเขียนโปรแกรมใช้คำสั่ง  Printf scanf
เขียนโปรแกรมใช้คำสั่ง Printf scanfธงชัย พาศรี
 
การวิเคราะห์ปัญหา(080653)
การวิเคราะห์ปัญหา(080653)การวิเคราะห์ปัญหา(080653)
การวิเคราะห์ปัญหา(080653)ธงชัย พาศรี
 
การเขียนผังงานแบบทำซ้ำ (080753)
การเขียนผังงานแบบทำซ้ำ  (080753)การเขียนผังงานแบบทำซ้ำ  (080753)
การเขียนผังงานแบบทำซ้ำ (080753)ธงชัย พาศรี
 
การเขียนผังงานแบบทางเลือก (050753)
การเขียนผังงานแบบทางเลือก  (050753)การเขียนผังงานแบบทางเลือก  (050753)
การเขียนผังงานแบบทางเลือก (050753)ธงชัย พาศรี
 
การเขียนผังงานแบบทางเลือก (010753)
การเขียนผังงานแบบทางเลือก  (010753)การเขียนผังงานแบบทางเลือก  (010753)
การเขียนผังงานแบบทางเลือก (010753)ธงชัย พาศรี
 
การเขียนผังงานแบบทางเลือก (050753)
การเขียนผังงานแบบทางเลือก  (050753)การเขียนผังงานแบบทางเลือก  (050753)
การเขียนผังงานแบบทางเลือก (050753)ธงชัย พาศรี
 
การเขียนผังงานแบบทางเลือก (010753)
การเขียนผังงานแบบทางเลือก  (010753)การเขียนผังงานแบบทางเลือก  (010753)
การเขียนผังงานแบบทางเลือก (010753)ธงชัย พาศรี
 

Plus de ธงชัย พาศรี (11)

ใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรมใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรม
 
เขียนโปรแกรมใช้คำสั่ง Printf scanf
เขียนโปรแกรมใช้คำสั่ง  Printf scanfเขียนโปรแกรมใช้คำสั่ง  Printf scanf
เขียนโปรแกรมใช้คำสั่ง Printf scanf
 
การวิเคราะห์ปัญหา(080653)
การวิเคราะห์ปัญหา(080653)การวิเคราะห์ปัญหา(080653)
การวิเคราะห์ปัญหา(080653)
 
การเขียนผังงานแบบทำซ้ำ (080753)
การเขียนผังงานแบบทำซ้ำ  (080753)การเขียนผังงานแบบทำซ้ำ  (080753)
การเขียนผังงานแบบทำซ้ำ (080753)
 
การเขียนผังงานแบบทางเลือก (050753)
การเขียนผังงานแบบทางเลือก  (050753)การเขียนผังงานแบบทางเลือก  (050753)
การเขียนผังงานแบบทางเลือก (050753)
 
การเขียนผังงานแบบทางเลือก (010753)
การเขียนผังงานแบบทางเลือก  (010753)การเขียนผังงานแบบทางเลือก  (010753)
การเขียนผังงานแบบทางเลือก (010753)
 
การเขียนผังงาน (290653)
การเขียนผังงาน (290653)การเขียนผังงาน (290653)
การเขียนผังงาน (290653)
 
การเขียนผังงาน (280653)
การเขียนผังงาน (280653)การเขียนผังงาน (280653)
การเขียนผังงาน (280653)
 
การเขียนผังงานแบบทางเลือก (050753)
การเขียนผังงานแบบทางเลือก  (050753)การเขียนผังงานแบบทางเลือก  (050753)
การเขียนผังงานแบบทางเลือก (050753)
 
การเขียนผังงานแบบทางเลือก (010753)
การเขียนผังงานแบบทางเลือก  (010753)การเขียนผังงานแบบทางเลือก  (010753)
การเขียนผังงานแบบทางเลือก (010753)
 
การเขียนผังงาน (290653)
การเขียนผังงาน (290653)การเขียนผังงาน (290653)
การเขียนผังงาน (290653)
 

Dernier

How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryCeline George
 
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxHVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxKunal10679
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Mohamed Rizk Khodair
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdfKamal Acharya
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIagpharmacy11
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the lifeNitinDeodare
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxCeline George
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfMinawBelay
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxheathfieldcps1
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Denish Jangid
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Celine George
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxNehaChandwani11
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatmentsaipooja36
 
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Mark Carrigan
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/siemaillard
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Celine George
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdfVikramadityaRaj
 

Dernier (20)

How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxHVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdf
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptx
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 

เขียนโปรแกรมใช้คำสั่ง Printf scanf

  • 1. 5 2553 - .................................................................... 40203 F ( F ) 5 F printf() scanf() F F F F F F F 1 F 0508531.CPP #include <stdio.h> #include <conio.h> main() F F { int score1,score2,score3,score4,score5; F F int scoretotal; F F float scoreave; F F scoretotal = 0; F 0 F scoretotal scoreave = 0; F 0 F scoreave printf( Please input number score 1 = ); F Please input number score 1 = scanf( %d ,&score1); F F F score1 printf( Please input number score 2 = ); F Please input number score 2 = scanf( %d ,&score2); F F F score2 printf( Please input number score 3 = ); F Please input number score 3 = scanf( %d ,&score3); F F F score3 printf( Please input number score 4 = ); F Please input number score 4 = scanf( %d ,&score4); F F F score4 printf( Please input number score 5 = ); F Please input number score 5 = scanf( %d ,&score5); F F F score1 printf( This is Total score : %d n ,scoretotal); F This is Total score : F scoretotal scoretotal = score1 + score2 + score3 + score4 + score5; F F F scoretotal scoreave = scoretotal/5; F scoretotal F 5 F F scoreave printf( This is Average score : %f ,scoreave); F This is Average score : F scoreave getch(); F F 1 } F
  • 2. 5 2553 - .................................................................... 2 F 0508532.CPP #include <stdio.h> #include <conio.h> main() F F { char name[15],surname[20]; int age; float gpascore; printf("Please input your name = " ); ..... scanf("%s",&name); .. printf("Please input your surname = " ); . scanf("%s",&surname); . printf("Please input your age = " ); .. scanf("%d",&age); . printf("Please input your gpa score = " ); . scanf("%f",&gpascore); . printf("Name : %s Surname : %s n",name,surname); printf("Age : %d n",age); .. printf("GPA score : %.2f ",gpascore); getch(); } F