SlideShare a Scribd company logo
1 of 20
Download to read offline
Introduction to Programming in C++
Eight Edition
Lesson 5.2:
The Selection Structure(Logical
Operators)
An Introduction to Programming with C++, Eight Edition
• Logical operators allow you to combine two or more
conditions (sub-conditions) into one compound
condition
• Also called as Boolean operators (always evaluate to true
or false)
• Two most common are And (&&) and Or (||)
• All sub-conditions must be true for a compound
condition using And to be true
• Only one of the sub-conditions must be true for a
compound condition using Or to be true
Logical Operators
2
An Introduction to Programming with C++, Eight Edition
• And evaluated before Or in an expression
• Logical operators evaluated after arithmetic and
comparison operators
• Parentheses can override precedence ordering
• Truth tables summarize how computer evaluates logical
operators
• Only necessary sub-conditions are evaluated; called
short-circuit evaluation
– Example: if first sub-condition in an And clause is false,
second sub-condition need not be evaluated
Logical Operators
3
An Introduction to Programming with C++, Eight Edition
Logical Operators
4
An Introduction to Programming with C++, Eight Edition
Logical Operators (cont’d.)
5
An Introduction to Programming with C++, Eight Edition
Using the Truth Tables
6
• Two example problem descriptions are given, and truth
tables for And and Or operators are used to find
appropriate sub-conditions and logical operators
• Calculate bonus for A-rated salespeople with monthly
sales greater than $5000
rating == ‘A’ && sales > 5000
• Send letter to all A-rated and B-rated salespeople rating
== ‘A’ || rating == ‘B’
An Introduction to Programming with C++, Eight Edition
• Example problem description is given in which the gross
pay of an employee must be calculated
• Program must verify that number of hours worked is
between 0 and 40
• Process of verifying that input data is within expected
range is known as data validation
• Program outputs gross pay if the number of hours
worked is valid and is an error message otherwise
SAMPLE PROBLEM(Calculating Gross Pay)
7
An Introduction to Programming with C++, Eight Edition
SAMPLE PROBLEM(Calculating Gross Pay)
8
Gross Pay program
An Introduction to Programming with C++, Eight Edition
Summary of Operators
9
Figure 5-19 Listing and an example of arithmetic,
comparison, and logical operators
An Introduction to Programming with C++, Eight Edition
Summary of Operators(cont’d)
10
Figure 5-19 Listing and an example of arithmetic,
comparison, and logical operators
An Introduction to Programming with C++, Eight Edition
• toupper and tolower functions used to convert
characters between uppercase and lowercase
• toupper function temporarily converts a character to
uppercase; tolower function temporarily converts a
character to lowercase
• Syntax is toupper(charVariable) and
tolower(charVariable)
• Item between parentheses in a function’s syntax is called
an argument – information the function needs to perform
its task
Converting a Character to Uppercase
or Lowercase
11
An Introduction to Programming with C++, Eight Edition
• Each function copies the character in its argument to a
temporary location in internal memory, converts the
character to the appropriate case, and returns the
temporary character
• Neither function changes the contents of its argument,
but rather, changes the temporary variable
Converting a Character to Uppercase
or Lowercase(cont’d)
12
An Introduction to Programming with C++, Eight Edition
Converting a Character to Uppercase
or Lowercase(cont’d)
13
An Introduction to Programming with C++, Eight Edition
• Real numbers are displayed in either fixed-point or
scientific (e) notation
• Small real numbers (six or less digits before decimal
place) displayed in fixed-point notation – Example:
1,234.56 displayed as 1234.560000
• Large real numbers (more than six digits before decimal
place) displayed in e notation – Example: 1,225,000.00
displayed as 1.225e+006
• Purpose of program determines appropriate format
Formatting Numeric Output
14
An Introduction to Programming with C++, Eight Edition
• Stream manipulators allow control over formatting
• fixed stream manipulator displays real numbers in fixed-
point notation
• scientific stream manipulator displays real numbers in e
notation
• Stream manipulator must appear in a cout statement
before numbers you want formatted
• Manipulator can appear by itself in a cout statement or
can be included with other information
Formatting Numeric Output(cont’d)
15
An Introduction to Programming with C++, Eight Edition
Formatting Numeric Output(cont’d)
16
• Manipulator remains in effect until end of program
execution or until another manipulator is processed
• Numbers formatted with fixed stream manipulator
always have six numbers to the right of the decimal place
– Number is padded with zeros if there aren’t six digits
Example: 123.456 is displayed as 123.456000
– Number is rounded and truncated if there are more than
six digits
Example: 123.3456789 is displayed as 123.345679
An Introduction to Programming with C++, Eight Edition
Formatting Numeric Output(cont’d)
17
• setprecision stream manipulator controls number of
decimal places
• Syntax setprecision(numberOfDecimalPlaces)
• You can include setprecision and fixed manipulators in
the same cout statement
• Definition of setprecision manipulator contained in
iomanip file
• Program must contain #include <iomanip> directive to
use setprecision manipulator
An Introduction to Programming with C++, Eight Edition
Formatting Numeric Output(cont’d)
18
An Introduction to Programming with C++, Eight Edition
Formatting Numeric Output(cont’d)
19
An Introduction to Programming with C++, Eight Edition
The End ♥ ♥ ♥
20

More Related Content

What's hot

Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
IIUM
 
Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
IIUM
 

What's hot (20)

Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Programming in c (importance of c)
Programming in c (importance of c)Programming in c (importance of c)
Programming in c (importance of c)
 
test(3)arithmetic in c
test(3)arithmetic in ctest(3)arithmetic in c
test(3)arithmetic in c
 
Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
 
Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14Csc1100 lecture03 ch03-pt2-s14
Csc1100 lecture03 ch03-pt2-s14
 
Lesson 9.1 value returning
Lesson 9.1 value returningLesson 9.1 value returning
Lesson 9.1 value returning
 
Lesson 6.2 logic error
Lesson  6.2 logic errorLesson  6.2 logic error
Lesson 6.2 logic error
 
Lesson 7.2 using counters and accumulators
Lesson 7.2 using counters and accumulatorsLesson 7.2 using counters and accumulators
Lesson 7.2 using counters and accumulators
 
Data flow model -Lecture-4
Data flow model -Lecture-4Data flow model -Lecture-4
Data flow model -Lecture-4
 
Verilog operators
Verilog operatorsVerilog operators
Verilog operators
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
9781285852744 ppt ch12
9781285852744 ppt ch129781285852744 ppt ch12
9781285852744 ppt ch12
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
9781285852744 ppt ch08
9781285852744 ppt ch089781285852744 ppt ch08
9781285852744 ppt ch08
 
C++ unit-1-part-10
C++ unit-1-part-10C++ unit-1-part-10
C++ unit-1-part-10
 
Unit I - Evaluation of expression
Unit I - Evaluation of expressionUnit I - Evaluation of expression
Unit I - Evaluation of expression
 
Fda unit 1 lec 1
Fda unit 1 lec  1Fda unit 1 lec  1
Fda unit 1 lec 1
 
Ppl
PplPpl
Ppl
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 

Similar to Lesson 5.2 logical operators

9781423902096_PPT_ch07.ppt
9781423902096_PPT_ch07.ppt9781423902096_PPT_ch07.ppt
9781423902096_PPT_ch07.ppt
LokeshK66
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
Tony Apreku
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
ssuserf86fba
 

Similar to Lesson 5.2 logical operators (20)

UoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdfUoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdf
 
C++ ch2
C++ ch2C++ ch2
C++ ch2
 
PPT slide_chapter 02 Basic element of C++.ppt
PPT slide_chapter 02 Basic element of C++.pptPPT slide_chapter 02 Basic element of C++.ppt
PPT slide_chapter 02 Basic element of C++.ppt
 
C++.ppt
C++.pptC++.ppt
C++.ppt
 
intro to differnt oper.pptx
intro to differnt oper.pptxintro to differnt oper.pptx
intro to differnt oper.pptx
 
final Unit 1-1.pdf
final Unit 1-1.pdffinal Unit 1-1.pdf
final Unit 1-1.pdf
 
OOPS-Seminar.pdf
OOPS-Seminar.pdfOOPS-Seminar.pdf
OOPS-Seminar.pdf
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
9781285852744 ppt ch02
9781285852744 ppt ch029781285852744 ppt ch02
9781285852744 ppt ch02
 
Intro To C++ - Cass 11 - Converting between types, formatting floating point,...
Intro To C++ - Cass 11 - Converting between types, formatting floating point,...Intro To C++ - Cass 11 - Converting between types, formatting floating point,...
Intro To C++ - Cass 11 - Converting between types, formatting floating point,...
 
Intro To C++ - Class 11 - Converting between types, formatting floating point...
Intro To C++ - Class 11 - Converting between types, formatting floating point...Intro To C++ - Class 11 - Converting between types, formatting floating point...
Intro To C++ - Class 11 - Converting between types, formatting floating point...
 
Basic syntax : Algorithm,Flow chart
Basic syntax : Algorithm,Flow chartBasic syntax : Algorithm,Flow chart
Basic syntax : Algorithm,Flow chart
 
C programming language
C programming languageC programming language
C programming language
 
9781423902096_PPT_ch07.ppt
9781423902096_PPT_ch07.ppt9781423902096_PPT_ch07.ppt
9781423902096_PPT_ch07.ppt
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
 
C Language Part 1
C Language Part 1C Language Part 1
C Language Part 1
 
AOA Week 01.ppt
AOA Week 01.pptAOA Week 01.ppt
AOA Week 01.ppt
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
 
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Algorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTSAlgorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTS
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
 
Algorithm manual
Algorithm manualAlgorithm manual
Algorithm manual
 

More from MLG College of Learning, Inc (20)

PC111.Lesson2
PC111.Lesson2PC111.Lesson2
PC111.Lesson2
 
PC111.Lesson1
PC111.Lesson1PC111.Lesson1
PC111.Lesson1
 
PC111-lesson1.pptx
PC111-lesson1.pptxPC111-lesson1.pptx
PC111-lesson1.pptx
 
PC LEESOON 6.pptx
PC LEESOON 6.pptxPC LEESOON 6.pptx
PC LEESOON 6.pptx
 
PC 106 PPT-09.pptx
PC 106 PPT-09.pptxPC 106 PPT-09.pptx
PC 106 PPT-09.pptx
 
PC 106 PPT-07
PC 106 PPT-07PC 106 PPT-07
PC 106 PPT-07
 
PC 106 PPT-01
PC 106 PPT-01PC 106 PPT-01
PC 106 PPT-01
 
PC 106 PPT-06
PC 106 PPT-06PC 106 PPT-06
PC 106 PPT-06
 
PC 106 PPT-05
PC 106 PPT-05PC 106 PPT-05
PC 106 PPT-05
 
PC 106 Slide 04
PC 106 Slide 04PC 106 Slide 04
PC 106 Slide 04
 
PC 106 Slide no.02
PC 106 Slide no.02PC 106 Slide no.02
PC 106 Slide no.02
 
pc-106-slide-3
pc-106-slide-3pc-106-slide-3
pc-106-slide-3
 
PC 106 Slide 2
PC 106 Slide 2PC 106 Slide 2
PC 106 Slide 2
 
PC 106 Slide 1.pptx
PC 106 Slide 1.pptxPC 106 Slide 1.pptx
PC 106 Slide 1.pptx
 
Db2 characteristics of db ms
Db2 characteristics of db msDb2 characteristics of db ms
Db2 characteristics of db ms
 
Db1 introduction
Db1 introductionDb1 introduction
Db1 introduction
 
Lesson 3.2
Lesson 3.2Lesson 3.2
Lesson 3.2
 
Lesson 3.1
Lesson 3.1Lesson 3.1
Lesson 3.1
 
Lesson 1.6
Lesson 1.6Lesson 1.6
Lesson 1.6
 
Lesson 3.2
Lesson 3.2Lesson 3.2
Lesson 3.2
 

Recently uploaded

Recently uploaded (20)

REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
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
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
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
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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Ữ Â...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
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
 

Lesson 5.2 logical operators

  • 1. Introduction to Programming in C++ Eight Edition Lesson 5.2: The Selection Structure(Logical Operators)
  • 2. An Introduction to Programming with C++, Eight Edition • Logical operators allow you to combine two or more conditions (sub-conditions) into one compound condition • Also called as Boolean operators (always evaluate to true or false) • Two most common are And (&&) and Or (||) • All sub-conditions must be true for a compound condition using And to be true • Only one of the sub-conditions must be true for a compound condition using Or to be true Logical Operators 2
  • 3. An Introduction to Programming with C++, Eight Edition • And evaluated before Or in an expression • Logical operators evaluated after arithmetic and comparison operators • Parentheses can override precedence ordering • Truth tables summarize how computer evaluates logical operators • Only necessary sub-conditions are evaluated; called short-circuit evaluation – Example: if first sub-condition in an And clause is false, second sub-condition need not be evaluated Logical Operators 3
  • 4. An Introduction to Programming with C++, Eight Edition Logical Operators 4
  • 5. An Introduction to Programming with C++, Eight Edition Logical Operators (cont’d.) 5
  • 6. An Introduction to Programming with C++, Eight Edition Using the Truth Tables 6 • Two example problem descriptions are given, and truth tables for And and Or operators are used to find appropriate sub-conditions and logical operators • Calculate bonus for A-rated salespeople with monthly sales greater than $5000 rating == ‘A’ && sales > 5000 • Send letter to all A-rated and B-rated salespeople rating == ‘A’ || rating == ‘B’
  • 7. An Introduction to Programming with C++, Eight Edition • Example problem description is given in which the gross pay of an employee must be calculated • Program must verify that number of hours worked is between 0 and 40 • Process of verifying that input data is within expected range is known as data validation • Program outputs gross pay if the number of hours worked is valid and is an error message otherwise SAMPLE PROBLEM(Calculating Gross Pay) 7
  • 8. An Introduction to Programming with C++, Eight Edition SAMPLE PROBLEM(Calculating Gross Pay) 8 Gross Pay program
  • 9. An Introduction to Programming with C++, Eight Edition Summary of Operators 9 Figure 5-19 Listing and an example of arithmetic, comparison, and logical operators
  • 10. An Introduction to Programming with C++, Eight Edition Summary of Operators(cont’d) 10 Figure 5-19 Listing and an example of arithmetic, comparison, and logical operators
  • 11. An Introduction to Programming with C++, Eight Edition • toupper and tolower functions used to convert characters between uppercase and lowercase • toupper function temporarily converts a character to uppercase; tolower function temporarily converts a character to lowercase • Syntax is toupper(charVariable) and tolower(charVariable) • Item between parentheses in a function’s syntax is called an argument – information the function needs to perform its task Converting a Character to Uppercase or Lowercase 11
  • 12. An Introduction to Programming with C++, Eight Edition • Each function copies the character in its argument to a temporary location in internal memory, converts the character to the appropriate case, and returns the temporary character • Neither function changes the contents of its argument, but rather, changes the temporary variable Converting a Character to Uppercase or Lowercase(cont’d) 12
  • 13. An Introduction to Programming with C++, Eight Edition Converting a Character to Uppercase or Lowercase(cont’d) 13
  • 14. An Introduction to Programming with C++, Eight Edition • Real numbers are displayed in either fixed-point or scientific (e) notation • Small real numbers (six or less digits before decimal place) displayed in fixed-point notation – Example: 1,234.56 displayed as 1234.560000 • Large real numbers (more than six digits before decimal place) displayed in e notation – Example: 1,225,000.00 displayed as 1.225e+006 • Purpose of program determines appropriate format Formatting Numeric Output 14
  • 15. An Introduction to Programming with C++, Eight Edition • Stream manipulators allow control over formatting • fixed stream manipulator displays real numbers in fixed- point notation • scientific stream manipulator displays real numbers in e notation • Stream manipulator must appear in a cout statement before numbers you want formatted • Manipulator can appear by itself in a cout statement or can be included with other information Formatting Numeric Output(cont’d) 15
  • 16. An Introduction to Programming with C++, Eight Edition Formatting Numeric Output(cont’d) 16 • Manipulator remains in effect until end of program execution or until another manipulator is processed • Numbers formatted with fixed stream manipulator always have six numbers to the right of the decimal place – Number is padded with zeros if there aren’t six digits Example: 123.456 is displayed as 123.456000 – Number is rounded and truncated if there are more than six digits Example: 123.3456789 is displayed as 123.345679
  • 17. An Introduction to Programming with C++, Eight Edition Formatting Numeric Output(cont’d) 17 • setprecision stream manipulator controls number of decimal places • Syntax setprecision(numberOfDecimalPlaces) • You can include setprecision and fixed manipulators in the same cout statement • Definition of setprecision manipulator contained in iomanip file • Program must contain #include <iomanip> directive to use setprecision manipulator
  • 18. An Introduction to Programming with C++, Eight Edition Formatting Numeric Output(cont’d) 18
  • 19. An Introduction to Programming with C++, Eight Edition Formatting Numeric Output(cont’d) 19
  • 20. An Introduction to Programming with C++, Eight Edition The End ♥ ♥ ♥ 20