top of page
Search
  • Writer's pictureHarshit Sharma

HOW TO USE OPERATORS

Operator

Description

Example – given a is 15 and b is 6

+

Addition

a + b, would return 21

-

Subtraction

a - b, would return 9

*

Multiplication

a * b, would return 90

/

Division

a / b, would return 2

%

Modulus

a % b, would return 3 (the remainder)

As we saw in the preceding example there are particular symbols used to represent operators when performing calculations: Operator

Description

Example – given a is 15 and b is 6

+

Addition

a + b, would return 21

-

Subtraction

a - b, would return 9

*

Multiplication

a * b, would return 90

/

Division

a / b, would return 2

%

Modulus

a % b, would return 3 (the remainder)


2 views0 comments

Recent Posts

See All

Comments


Post: Blog2_Post
bottom of page