Do Some Math

Use +, -, *, /, % to do basic math in C++.

In this lesson, you’ll use C++ as a calculator. You’ll write simple math operations, see the results instantly, and learn how to combine numbers in code.

Goal

You’ll aim to:

  • Use arithmetic operators.

  • Perform addition, subtraction, multiplication, division, and modulo.

  • Display results using cout.

Your first calculation

Here is a C++ program that performs addition and prints the result on the screen.

Get hands-on with 1400+ tech skills courses.