"'O
0
c
:J
0
li)
..--t
0
N
@
.......
J::
O'l
·;::::
>0.
0
u
~
0
:;
"' c:
0
c:
c:
.9
ü
:::l
2 o.
~
'l.)
:;
~
1
"8 c:
:::l
0
QJ
2)
Fonction factl(n : entier) : entier
Rôle : calcul itératif de n!
Variables locales : k,p (entiers)
Début
p ~ l
Si n==O Alors
1
Retourner (p)
FinSi
Pour k de 1 à n Faire
1 p ~ p ~' k
Fin Pour
Retourner(p)
Fin Fonction
3) La fonction inconnue(n) renvoie aussi n! à tout entier naturel n.
Exercices corrigés
221
Précédent

- 229/302

Suivant