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-s54
Koku Love
 
Forum2009 Sm Grp Disc Summary 0014
Forum2009 Sm Grp Disc Summary 0014Forum2009 Sm Grp Disc Summary 0014
Forum2009 Sm Grp Disc Summary 0014
Tom Loughran
 
13 แสง
13 แสง13 แสง
13 แสง
topofzeed
 
Lvb Sonate 10no1 1 Let
Lvb Sonate 10no1 1 LetLvb Sonate 10no1 1 Let
Lvb Sonate 10no1 1 Let
guest2dde99
 
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
chinkshady
 
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
hanktuba
 

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
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐาน
Krunee Thitthamon
 

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 C Unit2 C
Unit2 C
 
Unit2 C
Unit2 CUnit2 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

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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Ữ Â...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
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
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

เขียนโปรแกรมใช้คำสั่ง 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