# Programming in C++ language

The most important commands from C++ programming language in one place, a unique comparison and each command-operator is shown using a piece of program. Statements-operators of these sample programs are clickable, so with a simple click we have more information available.## Programming language C++:

## Lexical elements

Lexical elements are numeric, string constants and comments in the code.

## Types and variables

Types and variables are closely related because variables are the most important elements of our program in which we store data, partial results of our calculations. Types tell us what data can be stored in variables.

## Program structure

## Operators

Operators perform an operation between the operands, this operation can be mathematical, logical, or bitwise.

## Statements

Statements are important elements for writing programs. Generally one statement line corresponds to one line program. The main group of the statements are: cycles, program branching and flow control.

### C++

```
i = x * 5;
while (i>0)
if (i==10)
break;
else
{
i--;
}
```

### Examples - C++

### C++

```
float x = 3.14159265359; // x = 3.14159274
float y = 123456789; // y = 123456792.0
y =(float)(x * y); // z = 387850976.0
```

### C++

```
xmin = 0; ymax = 4294967295;
unsigned long x=70000; // x = 70000
unsigned long y = 1025 / 8; // y = 128
y = (unsigned long)(x * y); // z = 875043750
```

### C++

Other pieces of example codes:/* fdjksjf sdjgksdgjk */

if ( y < 100 ) x++;

if (i - 10 >0) i = i-5;

(2.5 / 2 + 1.25) + 2

i = x * 5;

x = 16 << 2

Programming languages

Compiler