SlideShare una empresa de Scribd logo
1 de 2
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

9. pointer, pointer & function
9. pointer, pointer & function9. pointer, pointer & function
9. pointer, pointer & function웅식 전
 
PL /SQL program UNIT 5 DMS 22319
PL /SQL program UNIT 5 DMS 22319PL /SQL program UNIT 5 DMS 22319
PL /SQL program UNIT 5 DMS 22319ARVIND SARDAR
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Tablesapdocs. info
 
C programs
C programsC programs
C programsMinu S
 
lFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective FuzzinglFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective FuzzingBjörn Mathis
 
C Programming by Süleyman Kondakci
C Programming by Süleyman KondakciC Programming by Süleyman Kondakci
C Programming by Süleyman KondakciSüleyman Kondakci
 
Javascript: Conceptos básicos
Javascript: Conceptos básicosJavascript: Conceptos básicos
Javascript: Conceptos básicosBelatrix Software
 
The solution manual of c by robin
The solution manual of c by robinThe solution manual of c by robin
The solution manual of c by robinAbdullah Al Naser
 
Catastrophic Cancellation
Catastrophic CancellationCatastrophic Cancellation
Catastrophic CancellationC4Media
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 

La actualidad más candente (20)

9. pointer, pointer & function
9. pointer, pointer & function9. pointer, pointer & function
9. pointer, pointer & function
 
Basics of c
Basics of cBasics of c
Basics of c
 
PL /SQL program UNIT 5 DMS 22319
PL /SQL program UNIT 5 DMS 22319PL /SQL program UNIT 5 DMS 22319
PL /SQL program UNIT 5 DMS 22319
 
CHAPTER 4
CHAPTER 4CHAPTER 4
CHAPTER 4
 
Calculator in cpp
Calculator in cppCalculator in cpp
Calculator in cpp
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
Presentación1
Presentación1Presentación1
Presentación1
 
BCNF V/S 3NF
BCNF V/S 3NFBCNF V/S 3NF
BCNF V/S 3NF
 
Hop ngu MIP
Hop ngu MIPHop ngu MIP
Hop ngu MIP
 
C programs
C programsC programs
C programs
 
lFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective FuzzinglFuzzer - Learning Input Tokens for Effective Fuzzing
lFuzzer - Learning Input Tokens for Effective Fuzzing
 
Po presentation ddc
Po presentation ddcPo presentation ddc
Po presentation ddc
 
C Programming by Süleyman Kondakci
C Programming by Süleyman KondakciC Programming by Süleyman Kondakci
C Programming by Süleyman Kondakci
 
Javascript: Conceptos básicos
Javascript: Conceptos básicosJavascript: Conceptos básicos
Javascript: Conceptos básicos
 
The solution manual of c by robin
The solution manual of c by robinThe solution manual of c by robin
The solution manual of c by robin
 
input
inputinput
input
 
Catastrophic Cancellation
Catastrophic CancellationCatastrophic Cancellation
Catastrophic Cancellation
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
Luhn sh
Luhn shLuhn sh
Luhn sh
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 

Similar a Calculate Average and Total Scores Using C Functions

บทที่ 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
 
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
 
miniLesson on the printf() function
miniLesson on the printf() functionminiLesson on the printf() function
miniLesson on the printf() functionChristine Wolfe
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐาน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
 

Similar a Calculate Average and Total Scores Using C Functions (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
 
ชนิดข้อมูลและตัวแปร
ชนิดข้อมูลและตัวแปรชนิดข้อมูลและตัวแปร
ชนิดข้อมูลและตัวแปร
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
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
 
miniLesson on the printf() function
miniLesson on the printf() functionminiLesson on the printf() function
miniLesson on the printf() function
 
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
 

Más de ธงชัย พาศรี

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

Más de ธงชัย พาศรี (11)

ใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรมใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรม
 
การกำหนดตัวแปร
การกำหนดตัวแปรการกำหนดตัวแปร
การกำหนดตัวแปร
 
การวิเคราะห์ปัญหา(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)
 

Calculate Average and Total Scores Using C Functions

  • 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