0% found this document useful (0 votes)
22 views1 page

Arithmetic Operators: Show Examples

Operators are symbols that tell the compiler to perform mathematical or logical manipulations in Scala. This document examines the different types of operators in Scala including arithmetic, relational, logical, bitwise, and assignment operators. It provides examples of common arithmetic operators like addition, subtraction, multiplication, and division, explaining what they do and providing sample calculations.

Uploaded by

RK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

Arithmetic Operators: Show Examples

Operators are symbols that tell the compiler to perform mathematical or logical manipulations in Scala. This document examines the different types of operators in Scala including arithmetic, relational, logical, bitwise, and assignment operators. It provides examples of common arithmetic operators like addition, subtraction, multiplication, and division, explaining what they do and providing sample calculations.

Uploaded by

RK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

An operator is a symbol that tells the compiler to perform specific mathematical or

logical manipulations. Scala is rich in built-in operators and provides the following types
of operators −

 Arithmetic Operators
 Relational Operators
 Logical Operators
 Bitwise Operators
 Assignment Operators
This chapter will examine the arithmetic, relational, logical, bitwise, assignment and
other operators one by one.

Arithmetic Operators
The following arithmetic operators are supported by Scala language. For example, let
us assume variable A holds 10 and variable B holds 20, then −
Show Examples

Operator Description Example

+ Adds two operands A+B


will give
30

- Subtracts second operand from the first A - B will


give -10

* Multiplies both operands A * B will


give 200

/ Divides numerator by de-numerator B / A will


give 2

% Modulus operator finds the remainder after division of one B%A


number by another will give
0

You might also like