Tester l'algorithme :


(cliquer sur le bouton ci-dessus pour lancer ou relancer l'exécution de l'algorithme)

Résultats :

Code de l'algorithme :
1     VARIABLES
2       x EST_DU_TYPE NOMBRE
3     DEBUT_ALGORITHME
4       AFFICHER "x="
5       LIRE x
6       AFFICHER x
7       SI (x>=-2 ET x<=1) ALORS
8         DEBUT_SI
9         x PREND_LA_VALEUR x+1
10        FIN_SI
11      SI (x>1 ET x<=4) ALORS
12        DEBUT_SI
13        x PREND_LA_VALEUR -pow(x,2)+1
14        FIN_SI
15      AFFICHER "f(x)="
16      AFFICHER x
17    FIN_ALGORITHME