Arithmetic operator
-
Upload
jordan-delacruz -
Category
Technology
-
view
409 -
download
2
description
Transcript of Arithmetic operator
![Page 1: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/1.jpg)
Arithmetic Operator
Prepared by: Jordan Delacruz Rona Mae Dominguez
![Page 2: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/2.jpg)
The operators are symbols which take one or more operands or expressions and carry out arithmetic or logical calculations.
Operators
Arithmetic operator
Relational operator
Logical Operator
Assignment Operator
Conditional Operators
Increment & Decrement Operators
Bitwise operators Special operators
![Page 3: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/3.jpg)
Arithmetic Operators
Operators that represent mathematical operations which perform numeric computations, for example, adding two numbers or raising the elements of an array to a given power.
![Page 4: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/4.jpg)
+ Operator
The addition operator is used to calculate the sum of two numbers.
![Page 5: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/5.jpg)
Example
10 20Operand 1 Operand 2
30
Operator
Output
![Page 6: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/6.jpg)
- Operator
The subtraction operator is used to find the difference between two numbers or to indicate the negative value of a numeric expression.
![Page 7: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/7.jpg)
Example
8 1Operand 1 Operand 2
7
Operator
Output
![Page 8: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/8.jpg)
Example
8Negatio
n
![Page 9: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/9.jpg)
* Operator
The multiplication operator is used to calculate the product of two numbers.
![Page 10: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/10.jpg)
Example
8 8Operand 1 Operand 2
64
Operator
Output
![Page 11: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/11.jpg)
/ Operator
The division operator is used to calculate the quotient of two numbers.
![Page 12: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/12.jpg)
Example
8 4Operand 1 Operand 2
2
Operator
Output
![Page 13: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/13.jpg)
^ Operator
The exponentiation operator raises a number to the power of an exponent.
![Page 14: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/14.jpg)
Example
8 2Operand 1 Operand 2
64
Operator
Output
![Page 15: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/15.jpg)
% Operator
The modulus operator divides two integers and returns the integer remainder.
![Page 16: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/16.jpg)
Example
8 5Operand 1 Operand 2
3
Operator
Output%mod
![Page 17: Arithmetic operator](https://reader033.fdocuments.us/reader033/viewer/2022060110/555e3331d8b42aad058b4585/html5/thumbnails/17.jpg)
Summary