C++ Output Numbers

C++ Print Numbers

You can also use cout() to print numbers.

However, unlike text, we don’t put numbers inside double quotes:

Example

#include <iostream>
using namespace std;

int main() {
  cout << 3;
  return 0;
}

You can also perform mathematical calculations:

Example

cout << 3 + 3;

Example

cout << 2 * 5;