\b;Les expressions
Les expressions peuvent contenir les opérations suivantes:

\c;+ \n;  addition
\c;- \n;  soustraction
\c;* \n;  multiplication
\c;/ \n;  division
\c;% \n;  reste de la division (seulement pour le type \c;\l;int\u cbot\int;\n;)

L'addition permet non seulement d'additionner des nombres, mais également d'appondre des \l;chaînes de caractères\u cbot\string;.
\c;
\s;	int    i = 12+3;      // donne 15
\s;	string s = "a"+"bc";  // donne "abc"
\s;	int    i = 2-5;       // donne -3
\s;	float  f = 3.01*10;   // donne 30.1
\s;	int    i = 5/3;       // donne 1
\s;	float  f = 5/3;       // donne 1.67
\s;	float  f = 5/0;       // donne une erreur
\s;	int    i = 13%5;      // donne 3
\s;	int    i = -8%3;      // donne -2
\n;
Une expression peut contenir des constantes ou des \l;variables\u cbot\var;. Par exemple:

\s;\c;	12+distance\n;

Les multiplications et les divisions sont effectuées avant les additions et les soustractions. En cas de doute, mieux vaut utiliser des parenthèses.
\c;
\s;	12*a+b/c \n;est équivalent à\c; (12*a)+(b/c)
\s;	2.5*(distance+marge)
\n;
Vous pouvez mettre autant d'espaces que vous le désirez, pour améliorer la lisibilité:
\c;
\s;	12*a + b/c
\s;	2.5 * (distance+marge)
\n;

\t;Compound assignment operators (for specialists)
Besides the \c;=\n; operators for variable assignment there are several compound-assignment operators.

The compound-assignment operators combine the \c;=\n; assignment operator with another binary operator such as \c;+\n; or \c;-\n;. Compound-assignment operators perform the operation specified by the additional operator and then assign the result to the left operand. For example, a compound-assignment expression such as   

\c;\s;expression1 += expression2
  
is equivalent to

\c;\s;expression1 = expression1 + expression2

\c;+=\n;  addition
\c;-=\n;  subtraction
\c;*=\n;  multiplication
\c;/=\n;  division
\c;%=\n;  remainder of the division (only for the type \c;\l;int\u cbot\int;\n;)

\t;Prefix and posfix increment- and decrement operators (for specialists)
The operators \c;++\n; and \c;--\n; allow you to increment (++) or to decrement (--) a variable in very compact and efficient manner.

For example to increment the variable \c;a\n; you can write
\c;\s;	a++ ;
\n;instead of
\c;\s;	a = a + 1 ;
\n;
The value of the expression \c;a++\n; is the value of the variable \c;a\n; before the increment. If you use the prefix operator \c;++a\n; the value of the expression is the value of the variable \c;a\n; after the increment. The same holds for the \c;--\n; decrement operator.

Examples:
\c;\s;	a = 2 ;
\s;	b = a++ ;
\s;	// now b contains 2 and a contains 3

\c;\s;	a = 2 ;
\s;	b = ++a ;
\s;	// now b contains 3 and a contains 3
\n;

\t;Voir aussi
\l;Programmation\u cbot;, \l;types\u cbot\type; et \l;catégories\u cbot\category;.
