User Tools

Site Tools


atelier:coding_gouter:ppour:conditionnels

This is an old revision of the document!


Conditionnels

When expressing idea, and rules you usually try to make something conditional. If something then something. And in programming there contsructs like this.

si conditionnel:
   déclaration

Let's have sample which find largest value out of thee entered.

a = entier(saisir("Le premier nombre: "))
b = entier(saisir("Deuxième numéro: "))
c = entier(saisir("Troisième numéro: "))
# Si a est supérieur à b et c, alors a est le plus grand
si (a >= b et a >= c):
    afficher("Le plus grand des trois: ", a)

# Si b est supérieur à a et c, alors b est le plus grand
si (b >= a et b >= c):
    afficher("Le plus grand des trois: ", b)

# Si c est supérieur à a et b, alors c est le plus grand
si (c >= a et c >= b):
    afficher("Le plus grand des trois: ", c)
atelier/coding_gouter/ppour/conditionnels.1776959591.txt.gz · Last modified: by Andrii Kurdiumov