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

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
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
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Recently uploaded (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
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
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

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. }