Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
A Little Math | Introduction to Operators
course content

Course Content

C++ Introduction

A Little MathA Little Math

These five mathematical operators (+, -, *, /, and %) serve to carry out various mathematical operations:

cpp

main.cpp

The modulo operator (%) calculates and returns the remainder resulting from a standard division operation.

The division operator (/) returns only the integer part of the result, discarding any remainder. For instance, when dividing 10 by 3, the result is 3, not 3.333... To obtain the desired division result with decimals (e.g., 10 / 3 = 3.333), it is necessary for at least one of the operands to be of a double or float data type.

cpp

main.cpp

The sum operator is the only mathematical operator that can be applied to string (that called concatenation):

cpp

main.cpp

There are also comparison operators (>, <, <=, >=). They are utilized when you need to numerically compare a value to a specific range:

cpp

main.cpp

1. What will be the output of the code:
2. What will be the output of the code:

What will be the output of the code:

Select the correct answer

What will be the output of the code:

Select the correct answer

Everything was clear?

Section 3. Chapter 2
course content

Course Content

C++ Introduction

A Little MathA Little Math

These five mathematical operators (+, -, *, /, and %) serve to carry out various mathematical operations:

cpp

main.cpp

The modulo operator (%) calculates and returns the remainder resulting from a standard division operation.

The division operator (/) returns only the integer part of the result, discarding any remainder. For instance, when dividing 10 by 3, the result is 3, not 3.333... To obtain the desired division result with decimals (e.g., 10 / 3 = 3.333), it is necessary for at least one of the operands to be of a double or float data type.

cpp

main.cpp

The sum operator is the only mathematical operator that can be applied to string (that called concatenation):

cpp

main.cpp

There are also comparison operators (>, <, <=, >=). They are utilized when you need to numerically compare a value to a specific range:

cpp

main.cpp

1. What will be the output of the code:
2. What will be the output of the code:

What will be the output of the code:

Select the correct answer

What will be the output of the code:

Select the correct answer

Everything was clear?

Section 3. Chapter 2
some-alt