Arithmetic operator

Post on 22-May-2015

409 views 2 download

Tags:

description

Arithmetic Operation-Reviewer!

Transcript of Arithmetic operator

Arithmetic Operator

Prepared by: Jordan Delacruz Rona Mae Dominguez

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

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.

+ Operator

The addition operator is used to calculate the sum of two numbers.

Example

10 20Operand 1 Operand 2

30

Operator

Output

- Operator

The subtraction operator is used to find the difference between two numbers or to indicate the negative value of a numeric expression.

Example

8 1Operand 1 Operand 2

7

Operator

Output

Example

8Negatio

n

* Operator

The multiplication operator is used to calculate the product of two numbers.

Example

8 8Operand 1 Operand 2

64

Operator

Output

/ Operator

The division operator is used to calculate the quotient of two numbers.

Example

8 4Operand 1 Operand 2

2

Operator

Output

^ Operator

The exponentiation operator raises a number to the power of an exponent.

Example

8 2Operand 1 Operand 2

64

Operator

Output

% Operator

The modulus operator divides two integers and returns the integer remainder.

Example

8 5Operand 1 Operand 2

3

Operator

Output%mod

Summary