Académique Documents
Professionnel Documents
Culture Documents
+ Addi
i +
+3 9
- Sub
i
-b 5
* Mul
ili
i *
*
ivii
ub
5
Mdul diviiiv
% %
b%
id
º
º
ºb
º
u l º
º 9u
!
b " l
!
u l
b 9u
#u l
b
" l
$ %
u l
$
&$b 9u
¬
w
w w
c ×
c Let a=10, b=15 and c=5
() ** ( " l
() '' (
ue
$ () 9ue
%
c The increment (++) and decrement (--) are unary operators.
c The operand must be a variable and cannot be constant or
expression.
c The ++ operator increments the operand by one and the
decrement operator decrements the operators by 1.
c The increment and decrement operator can precede or succeed
the operand.
c If the operator precedes the operand then operand is
incremented or decremented before it is used.
c If the operator succeeds the operand then the operand is
incremented or decremented after it is used.
c ×
c A++ i-- ++d --dif
ñ
c Conditional operator is a ternary operator.
c It is used to build simple conditional expressions.
c
c The expression1 is evaluated first. If it is true the expression 2 is evaluated and value is
assigned to the variable and if the condition is false then expression3 is evaluated and the value is
assigned to the variable.
c Expression 1 is a relational or logical expression
c Expression 2 can be arithmetic, relational or logical expression.
c ×
c Big=a>b ? a : b
c In this example if the expression a>b is true then big is assigned the value of a else the value
of b is assigned to the big