1std::string str = "text"; // stores a string
2int foo = 3; // stores any integer
3float bar = 3.14; // stores 32 bit number
4double baz = 3.14159265; // stores 64 bit number
1// operating with variables
2
3#include <iostream>
4using namespace std;
5
6int main ()
7{
8 // declaring variables:
9 int a, b;
10 int result;
11
12 // process:
13 a = 5;
14 b = 2;
15 a = a + 1;
16 result = a - b;
17
18 // print out the result:
19 cout << result;
20
21 // terminate the program:
22 return 0;
23}