SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
CS111 Lab
Arithmetic
Instructor: Michael Gordon
C++ Arithmetic Operators
 + Addition
 - Subtraction
 * Multiplication
 / Division
 % Modulus (remainder)
 () Parentheses
Order of Operations
 ()
 * / %
 + -
 (4 + 2) / 2 + 4 = ???
 Operation in () first: 4+2=6
 Division next: 6 / 2 = 3
 Last addition, 3 + 4 = 7
Integer and Decimal Division
 Division of two integers drops the decimal:
 5 / 2 = 2 (not 2.5)
 4 / 2 = 2
 Division involving a double type, will result
in a double result (with decimal)
 5 / 2.0 = 2.5
 4 / 2.0 = 2
 One or both numbers must be a double
 Same rules apply to addition, subtraction
and multiplication.
Data Types and Order
 Sample operations and resulting data
types:
 6.0 + 5 / 2
 Result of first operation: int
 Result of second operation: double
 • 5 + 5 / 2.0
 Result of first operation: double
 Result of second operation: double
Type casting
 Type casting changes one type to
another.
 For example if you want a double type
result of integer division, you can do this:
 double result = (double) 5 / 2
 result now equals 2.5
Type casting
 Reverse example (double to int)
 Drops the decimal part
 double total = 100.5;
 int value = (int) total;
 value now equals 100.

Mais conteúdo relacionado

Mais procurados

Quantitative Analysis For Decision Making
Quantitative Analysis For Decision MakingQuantitative Analysis For Decision Making
Quantitative Analysis For Decision Makingaminsand
 
Sept. 21, 2012
Sept. 21, 2012Sept. 21, 2012
Sept. 21, 2012khyps13
 
Survey On Two-Term Dot Product Of Multiplier Using Floating Point
Survey On Two-Term Dot Product Of Multiplier Using Floating PointSurvey On Two-Term Dot Product Of Multiplier Using Floating Point
Survey On Two-Term Dot Product Of Multiplier Using Floating PointIRJET Journal
 
Solving one step equations (workshop 1)
Solving one step equations (workshop 1)Solving one step equations (workshop 1)
Solving one step equations (workshop 1)ktyler12
 
Chapter 7 Formats in MATLAB
Chapter 7 Formats in MATLABChapter 7 Formats in MATLAB
Chapter 7 Formats in MATLABPranoti Doke
 
Fantacy foot ball introduction
Fantacy foot ball introductionFantacy foot ball introduction
Fantacy foot ball introductionshay1204
 
Powers and Exponents.pptx
Powers and Exponents.pptxPowers and Exponents.pptx
Powers and Exponents.pptxNeilfieOrit2
 
5 5b Slope Intercept Form from Two Points
5 5b Slope Intercept Form from Two Points5 5b Slope Intercept Form from Two Points
5 5b Slope Intercept Form from Two PointsBitsy Griffin
 
Add and Subtract Decimals
Add and Subtract DecimalsAdd and Subtract Decimals
Add and Subtract DecimalsBrooke Young
 
Linear Programming Project
Linear Programming ProjectLinear Programming Project
Linear Programming ProjectChawal Ukesh
 
Untitled 2
Untitled 2Untitled 2
Untitled 2lstreet1
 
DIVISION: TWO-DIGIT DIVISOR
DIVISION: TWO-DIGIT DIVISORDIVISION: TWO-DIGIT DIVISOR
DIVISION: TWO-DIGIT DIVISORJohdener14
 
Lesson 33: The Assignment Problem
Lesson 33: The Assignment  ProblemLesson 33: The Assignment  Problem
Lesson 33: The Assignment ProblemMatthew Leingang
 

Mais procurados (19)

Quantitative Analysis For Decision Making
Quantitative Analysis For Decision MakingQuantitative Analysis For Decision Making
Quantitative Analysis For Decision Making
 
Order of Operations
Order of OperationsOrder of Operations
Order of Operations
 
Sept. 21, 2012
Sept. 21, 2012Sept. 21, 2012
Sept. 21, 2012
 
Assignment Problem
Assignment ProblemAssignment Problem
Assignment Problem
 
Survey On Two-Term Dot Product Of Multiplier Using Floating Point
Survey On Two-Term Dot Product Of Multiplier Using Floating PointSurvey On Two-Term Dot Product Of Multiplier Using Floating Point
Survey On Two-Term Dot Product Of Multiplier Using Floating Point
 
Solving one step equations (workshop 1)
Solving one step equations (workshop 1)Solving one step equations (workshop 1)
Solving one step equations (workshop 1)
 
Chapter 7 Formats in MATLAB
Chapter 7 Formats in MATLABChapter 7 Formats in MATLAB
Chapter 7 Formats in MATLAB
 
Mathematichs
MathematichsMathematichs
Mathematichs
 
Assignment Problem
Assignment ProblemAssignment Problem
Assignment Problem
 
Inequalities
InequalitiesInequalities
Inequalities
 
Fantacy foot ball introduction
Fantacy foot ball introductionFantacy foot ball introduction
Fantacy foot ball introduction
 
Powers and Exponents.pptx
Powers and Exponents.pptxPowers and Exponents.pptx
Powers and Exponents.pptx
 
5 5b Slope Intercept Form from Two Points
5 5b Slope Intercept Form from Two Points5 5b Slope Intercept Form from Two Points
5 5b Slope Intercept Form from Two Points
 
Add and Subtract Decimals
Add and Subtract DecimalsAdd and Subtract Decimals
Add and Subtract Decimals
 
Linear Programming Project
Linear Programming ProjectLinear Programming Project
Linear Programming Project
 
Untitled 2
Untitled 2Untitled 2
Untitled 2
 
DIVISION: TWO-DIGIT DIVISOR
DIVISION: TWO-DIGIT DIVISORDIVISION: TWO-DIGIT DIVISOR
DIVISION: TWO-DIGIT DIVISOR
 
Lesson 33: The Assignment Problem
Lesson 33: The Assignment  ProblemLesson 33: The Assignment  Problem
Lesson 33: The Assignment Problem
 
Fractions
FractionsFractions
Fractions
 

Destaque

2010 1st sem_course_module_hotel_accountancy.2010
2010 1st  sem_course_module_hotel_accountancy.20102010 1st  sem_course_module_hotel_accountancy.2010
2010 1st sem_course_module_hotel_accountancy.2010Profkunal
 
What's Next for Western Europe
What's Next for Western EuropeWhat's Next for Western Europe
What's Next for Western EuropeHavasPR
 
Recyclingandjobsinmassachusetts
RecyclingandjobsinmassachusettsRecyclingandjobsinmassachusetts
Recyclingandjobsinmassachusettsmlg2011
 
Smp presentation incl videos 1g
Smp presentation incl videos 1gSmp presentation incl videos 1g
Smp presentation incl videos 1gcartridgeexpert
 
Difan Zhang IMC project
Difan Zhang IMC projectDifan Zhang IMC project
Difan Zhang IMC projectDifan Zhang
 
The Green Roundtable Brings it All Together at NEXUS Green Resource Center
The Green Roundtable Brings it All Together at NEXUS Green Resource CenterThe Green Roundtable Brings it All Together at NEXUS Green Resource Center
The Green Roundtable Brings it All Together at NEXUS Green Resource CenterSustainable Performance Institute
 
10 million solar roofs act of 2011
10 million solar roofs act of 201110 million solar roofs act of 2011
10 million solar roofs act of 2011Sunworks
 

Destaque (7)

2010 1st sem_course_module_hotel_accountancy.2010
2010 1st  sem_course_module_hotel_accountancy.20102010 1st  sem_course_module_hotel_accountancy.2010
2010 1st sem_course_module_hotel_accountancy.2010
 
What's Next for Western Europe
What's Next for Western EuropeWhat's Next for Western Europe
What's Next for Western Europe
 
Recyclingandjobsinmassachusetts
RecyclingandjobsinmassachusettsRecyclingandjobsinmassachusetts
Recyclingandjobsinmassachusetts
 
Smp presentation incl videos 1g
Smp presentation incl videos 1gSmp presentation incl videos 1g
Smp presentation incl videos 1g
 
Difan Zhang IMC project
Difan Zhang IMC projectDifan Zhang IMC project
Difan Zhang IMC project
 
The Green Roundtable Brings it All Together at NEXUS Green Resource Center
The Green Roundtable Brings it All Together at NEXUS Green Resource CenterThe Green Roundtable Brings it All Together at NEXUS Green Resource Center
The Green Roundtable Brings it All Together at NEXUS Green Resource Center
 
10 million solar roofs act of 2011
10 million solar roofs act of 201110 million solar roofs act of 2011
10 million solar roofs act of 2011
 

Semelhante a Arithmetic

Adding and subtracting
Adding and subtractingAdding and subtracting
Adding and subtractingDiana Pineda
 
Thursday, september 26, 2013
Thursday, september 26, 2013Thursday, september 26, 2013
Thursday, september 26, 2013khyps13
 
Ch02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsCh02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsJames Brotsos
 
1 arithmetic
1 arithmetic1 arithmetic
1 arithmeticfyjordan9
 
For Loops and Variables in Java
For Loops and Variables in JavaFor Loops and Variables in Java
For Loops and Variables in JavaPokequesthero
 
divisibilitytheory_2042918529272231.pptx
divisibilitytheory_2042918529272231.pptxdivisibilitytheory_2042918529272231.pptx
divisibilitytheory_2042918529272231.pptxJasminOriel1
 
Facility Layout in production management
Facility Layout in production managementFacility Layout in production management
Facility Layout in production managementJoshua Miranda
 
Civil Service Review in Math.pptx
Civil Service Review in Math.pptxCivil Service Review in Math.pptx
Civil Service Review in Math.pptxEllaineEspinosa1
 
11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docx
11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docx11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docx
11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docxhyacinthshackley2629
 
3 Performing Mensuration and Calculation.pptx
3 Performing  Mensuration and Calculation.pptx3 Performing  Mensuration and Calculation.pptx
3 Performing Mensuration and Calculation.pptxGemDL
 
09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptx
09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptx09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptx
09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptxMariaDorisBorja
 

Semelhante a Arithmetic (20)

Adding and subtracting
Adding and subtractingAdding and subtracting
Adding and subtracting
 
Thursday, september 26, 2013
Thursday, september 26, 2013Thursday, september 26, 2013
Thursday, september 26, 2013
 
Ch02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsCh02 primitive-data-definite-loops
Ch02 primitive-data-definite-loops
 
1 arithmetic
1 arithmetic1 arithmetic
1 arithmetic
 
CST2403 NOTES
CST2403 NOTESCST2403 NOTES
CST2403 NOTES
 
For Loops and Variables in Java
For Loops and Variables in JavaFor Loops and Variables in Java
For Loops and Variables in Java
 
divisibilitytheory_2042918529272231.pptx
divisibilitytheory_2042918529272231.pptxdivisibilitytheory_2042918529272231.pptx
divisibilitytheory_2042918529272231.pptx
 
Difference of Two Squares
Difference of Two SquaresDifference of Two Squares
Difference of Two Squares
 
Facility Layout in production management
Facility Layout in production managementFacility Layout in production management
Facility Layout in production management
 
Data type
Data typeData type
Data type
 
2 data 2011
2 data 20112 data 2011
2 data 2011
 
order of operations
order of operationsorder of operations
order of operations
 
coefficient variation
coefficient variationcoefficient variation
coefficient variation
 
Oop project
Oop projectOop project
Oop project
 
Civil Service Review in Math.pptx
Civil Service Review in Math.pptxCivil Service Review in Math.pptx
Civil Service Review in Math.pptx
 
11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docx
11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docx11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docx
11414 2.3 Homework (Quadratic Equations)courses.thinkwel.docx
 
3 Performing Mensuration and Calculation.pptx
3 Performing  Mensuration and Calculation.pptx3 Performing  Mensuration and Calculation.pptx
3 Performing Mensuration and Calculation.pptx
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Polynomial Operations
Polynomial OperationsPolynomial Operations
Polynomial Operations
 
09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptx
09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptx09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptx
09.30.2019 to 10.03.2019 Polynomials Algebra111 I.pptx
 

Mais de Michael Gordon (18)

Raspberry Pi presentation for Computer Architecture class
Raspberry Pi presentation for Computer Architecture classRaspberry Pi presentation for Computer Architecture class
Raspberry Pi presentation for Computer Architecture class
 
Strings2
Strings2Strings2
Strings2
 
Strings1
Strings1Strings1
Strings1
 
Introduction to Computer Science 111 Lab
Introduction to Computer Science 111 LabIntroduction to Computer Science 111 Lab
Introduction to Computer Science 111 Lab
 
Introduction to Linux, Pico, G++
Introduction to Linux, Pico, G++Introduction to Linux, Pico, G++
Introduction to Linux, Pico, G++
 
Strings
StringsStrings
Strings
 
Arrays, continued
Arrays, continuedArrays, continued
Arrays, continued
 
Arrays
ArraysArrays
Arrays
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
Functions
FunctionsFunctions
Functions
 
Shape logic 1
Shape logic 1Shape logic 1
Shape logic 1
 
For loops
For loopsFor loops
For loops
 
While loops
While loopsWhile loops
While loops
 
If statements
If statementsIf statements
If statements
 
Variables
VariablesVariables
Variables
 
Output
OutputOutput
Output
 
Word cloud
Word cloudWord cloud
Word cloud
 
Millennial white paper
Millennial white paperMillennial white paper
Millennial white paper
 

Último

GUWAHATI 💋 Call Girl 9827461493 Call Girls in Escort service book now
GUWAHATI 💋 Call Girl 9827461493 Call Girls in  Escort service book nowGUWAHATI 💋 Call Girl 9827461493 Call Girls in  Escort service book now
GUWAHATI 💋 Call Girl 9827461493 Call Girls in Escort service book nowkapoorjyoti4444
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Adnet Communications
 
Cannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannaBusinessPlans
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxDitasDelaCruz
 
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...NadhimTaha
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwaitdaisycvs
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSpanmisemningshen123
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistanvineshkumarsajnani12
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingNauman Safdar
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubaijaehdlyzca
 
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...pujan9679
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPanhandleOilandGas
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGpr788182
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...daisycvs
 
Kalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book nowKalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book nowranineha57744
 
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Falcon Invoice Discounting
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptxnandhinijagan9867
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165meghakumariji156
 
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAIGetting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAITim Wilson
 

Último (20)

GUWAHATI 💋 Call Girl 9827461493 Call Girls in Escort service book now
GUWAHATI 💋 Call Girl 9827461493 Call Girls in  Escort service book nowGUWAHATI 💋 Call Girl 9827461493 Call Girls in  Escort service book now
GUWAHATI 💋 Call Girl 9827461493 Call Girls in Escort service book now
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
 
Cannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 Updated
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
 
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Kalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book nowKalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book now
 
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
 
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAIGetting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
 

Arithmetic

  • 2. C++ Arithmetic Operators  + Addition  - Subtraction  * Multiplication  / Division  % Modulus (remainder)  () Parentheses
  • 3. Order of Operations  ()  * / %  + -  (4 + 2) / 2 + 4 = ???  Operation in () first: 4+2=6  Division next: 6 / 2 = 3  Last addition, 3 + 4 = 7
  • 4. Integer and Decimal Division  Division of two integers drops the decimal:  5 / 2 = 2 (not 2.5)  4 / 2 = 2  Division involving a double type, will result in a double result (with decimal)  5 / 2.0 = 2.5  4 / 2.0 = 2  One or both numbers must be a double  Same rules apply to addition, subtraction and multiplication.
  • 5. Data Types and Order  Sample operations and resulting data types:  6.0 + 5 / 2  Result of first operation: int  Result of second operation: double  • 5 + 5 / 2.0  Result of first operation: double  Result of second operation: double
  • 6. Type casting  Type casting changes one type to another.  For example if you want a double type result of integer division, you can do this:  double result = (double) 5 / 2  result now equals 2.5
  • 7. Type casting  Reverse example (double to int)  Drops the decimal part  double total = 100.5;  int value = (int) total;  value now equals 100.