SlideShare a Scribd company logo
1 of 5
PBL8.1




1.

2.



3.
PBL 8.1




1.
2.
3.




-                                   %
-



                               /
               -



               http://www.lks.ac.th/kuanjit/
scanf.htm

                     http://ba.hcu.ac.th/Elearnin
                     g/elearn.htm




                                               %




scanf ( )




#include <stdio.h>
#include <conio.h>
main()
{
float x1,P1,total,x2,P2,discount;
char product1[10],name[10],product2[10];
printf("nEnter your namet:t");
scanf("%s",name);
printf("nProduct1t:t");
scanf("%s",product1);
printf("nUnit1tt:t");
scanf("%f",&x1);
printf("nPrice1tt:t");
scanf("%f",&P1);
printf("n+++++++++++++++++++++++++n");
printf("nnProduct2t:t");
scanf("%s",product2);
printf("nx2tt:t");
scanf("%f",&x2);
printf("nP2tt:t");
scanf("%f",&P2);
total=((x1*P1)+(x2*P2));
discount=(total*.10);
printf("n+++++++++++++++++++++++++nn");
printf("Total Price ==>t:t%.2f",total);
printf("n+++++++++++++++++++++++++nn");
printf("ndiscount 10% ==>t:t%.2f",discount);
getch();
}

More Related Content

What's hot (20)

JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring Roo
 
#2
#2#2
#2
 
basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++
 
Circular queue
Circular queueCircular queue
Circular queue
 
Fork handout
Fork handoutFork handout
Fork handout
 
Phpbase
PhpbasePhpbase
Phpbase
 
Array list
Array listArray list
Array list
 
Bubble Sort
Bubble SortBubble Sort
Bubble Sort
 
Array imp of list
Array imp of listArray imp of list
Array imp of list
 
Storytelling By Numbers
Storytelling By NumbersStorytelling By Numbers
Storytelling By Numbers
 
Data Structures : array operations in c program
Data Structures : array operations in c program Data Structures : array operations in c program
Data Structures : array operations in c program
 
basic shell_programs
 basic shell_programs basic shell_programs
basic shell_programs
 
Binary search
Binary searchBinary search
Binary search
 
The Truth About Lambdas in PHP
The Truth About Lambdas in PHPThe Truth About Lambdas in PHP
The Truth About Lambdas in PHP
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
Laravel the right way
Laravel   the right wayLaravel   the right way
Laravel the right way
 
week-15x
week-15xweek-15x
week-15x
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
StackArray stack3
StackArray stack3StackArray stack3
StackArray stack3
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7
 

Viewers also liked

Viewers also liked (20)

Pbl4.1
Pbl4.1Pbl4.1
Pbl4.1
 
оптические методы исследования потоков 2003
оптические методы исследования потоков 2003оптические методы исследования потоков 2003
оптические методы исследования потоков 2003
 
Pbl 6
Pbl 6Pbl 6
Pbl 6
 
Nova reklama marketingovoe prodvigenie
Nova reklama marketingovoe prodvigenieNova reklama marketingovoe prodvigenie
Nova reklama marketingovoe prodvigenie
 
Bank mini
Bank miniBank mini
Bank mini
 
130614 ist constructivo
130614 ist constructivo130614 ist constructivo
130614 ist constructivo
 
Memories at GITAM
Memories at GITAMMemories at GITAM
Memories at GITAM
 
Pbl 6
Pbl 6Pbl 6
Pbl 6
 
Pbl1
Pbl1Pbl1
Pbl1
 
Pbl3
Pbl3Pbl3
Pbl3
 
P73 76
P73 76P73 76
P73 76
 
geosurge-00
geosurge-00geosurge-00
geosurge-00
 
Pbl 6
Pbl 6Pbl 6
Pbl 6
 
เฟียเจท์ 1
เฟียเจท์ 1เฟียเจท์ 1
เฟียเจท์ 1
 
P85 89
P85 89P85 89
P85 89
 
Pbl 4.2
Pbl 4.2Pbl 4.2
Pbl 4.2
 
2011611009
20116110092011611009
2011611009
 
Nova reklama marketingovoe prodvigenie
Nova reklama marketingovoe prodvigenieNova reklama marketingovoe prodvigenie
Nova reklama marketingovoe prodvigenie
 
The Cloud Native Journey with Simon Elisha
The Cloud Native Journey with Simon ElishaThe Cloud Native Journey with Simon Elisha
The Cloud Native Journey with Simon Elisha
 
Pbl2
Pbl2Pbl2
Pbl2
 

Similar to 8.1

Compiler Design Lab File
Compiler Design Lab FileCompiler Design Lab File
Compiler Design Lab FileKandarp Tiwari
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)Ashishchinu
 
The solution manual of programming in ansi by Robin
The solution manual of programming in ansi by RobinThe solution manual of programming in ansi by Robin
The solution manual of programming in ansi by RobinShariful Haque Robin
 
C basics
C basicsC basics
C basicsMSc CST
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using CBilal Mirza
 
Wildlife conservation project management adri jovin
Wildlife conservation project management  adri jovinWildlife conservation project management  adri jovin
Wildlife conservation project management adri jovinAdri Jovin
 
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
 
2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io웅식 전
 
Bankers Algo Implementation
Bankers Algo ImplementationBankers Algo Implementation
Bankers Algo ImplementationDeepak Agarwal
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซีkramsri
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovinAdri Jovin
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY MazedurMazedurr rahman
 
Data structure output 1
Data structure output 1Data structure output 1
Data structure output 1Balaji Thala
 

Similar to 8.1 (20)

Compiler Design Lab File
Compiler Design Lab FileCompiler Design Lab File
Compiler Design Lab File
 
C Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossainC Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossain
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
The solution manual of programming in ansi by Robin
The solution manual of programming in ansi by RobinThe solution manual of programming in ansi by Robin
The solution manual of programming in ansi by Robin
 
C basics
C basicsC basics
C basics
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Wildlife conservation project management adri jovin
Wildlife conservation project management  adri jovinWildlife conservation project management  adri jovin
Wildlife conservation project management adri jovin
 
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
 
2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io
 
C Programming lab
C Programming labC Programming lab
C Programming lab
 
Bankers Algo Implementation
Bankers Algo ImplementationBankers Algo Implementation
Bankers Algo Implementation
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
C programms
C programmsC programms
C programms
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovin
 
Presentation1
Presentation1Presentation1
Presentation1
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY Mazedur
 
Fucntions & Pointers in C
Fucntions & Pointers in CFucntions & Pointers in C
Fucntions & Pointers in C
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
 
Data structure output 1
Data structure output 1Data structure output 1
Data structure output 1
 

More from namthip2539

More from namthip2539 (8)

8.2
8.28.2
8.2
 
Pbl7.2
Pbl7.2Pbl7.2
Pbl7.2
 
Pbl 7.2
Pbl 7.2Pbl 7.2
Pbl 7.2
 
Pbl 7.1
Pbl 7.1Pbl 7.1
Pbl 7.1
 
Pbl 5
Pbl 5Pbl 5
Pbl 5
 
Pbl3
Pbl3Pbl3
Pbl3
 
โจทย์ปัญหาPbl1
โจทย์ปัญหาPbl1โจทย์ปัญหาPbl1
โจทย์ปัญหาPbl1
 
Pbl 2
Pbl 2Pbl 2
Pbl 2
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

8.1

  • 2. PBL 8.1 1. 2. 3. - % - / - http://www.lks.ac.th/kuanjit/
  • 3. scanf.htm http://ba.hcu.ac.th/Elearnin g/elearn.htm % scanf ( ) #include <stdio.h> #include <conio.h> main()
  • 4. { float x1,P1,total,x2,P2,discount; char product1[10],name[10],product2[10]; printf("nEnter your namet:t"); scanf("%s",name); printf("nProduct1t:t"); scanf("%s",product1); printf("nUnit1tt:t"); scanf("%f",&x1); printf("nPrice1tt:t"); scanf("%f",&P1); printf("n+++++++++++++++++++++++++n"); printf("nnProduct2t:t"); scanf("%s",product2); printf("nx2tt:t"); scanf("%f",&x2); printf("nP2tt:t"); scanf("%f",&P2); total=((x1*P1)+(x2*P2)); discount=(total*.10); printf("n+++++++++++++++++++++++++nn"); printf("Total Price ==>t:t%.2f",total); printf("n+++++++++++++++++++++++++nn"); printf("ndiscount 10% ==>t:t%.2f",discount); getch();
  • 5. }