Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Basic Arithmetic | Syntax and Basic Operations
R Introduction

bookBasic Arithmetic

In R, arithmetic expressions can be written directly in the console, and the result is displayed without the need for an explicit print function.

Arithmetic Operators

You can use the following operators for basic arithmetic:

  • + for addition;
  • - for subtraction;
  • * for multiplication;
  • / for division.

Example

1234
12 + 21 32 - 16 10 * 11 13 / 5
copy
Note
Note

Each new operation should start on a new line.

Task

Swipe to start coding

Perform the following calculations using basic arithmetic operations:

  1. 30 + 24;
  2. 50 - 36;
  3. 19 * 7;
  4. 20 / 4.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 2.27

bookBasic Arithmetic

Swipe to show menu

In R, arithmetic expressions can be written directly in the console, and the result is displayed without the need for an explicit print function.

Arithmetic Operators

You can use the following operators for basic arithmetic:

  • + for addition;
  • - for subtraction;
  • * for multiplication;
  • / for division.

Example

1234
12 + 21 32 - 16 10 * 11 13 / 5
copy
Note
Note

Each new operation should start on a new line.

Task

Swipe to start coding

Perform the following calculations using basic arithmetic operations:

  1. 30 + 24;
  2. 50 - 36;
  3. 19 * 7;
  4. 20 / 4.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 2.27
SectionΒ 1. ChapterΒ 2
single

single

some-alt