Fiche rapide

Instructions conditionnelles

Maths • algorithmique

1Definition

Si condition alors bloc1 sinon bloc2.

3A retenir

  • ✓Si condition vraie → execute le bloc Alors
  • ✓Si condition fausse → execute le bloc Sinon (s'il existe)
  • ✓Le Sinon est optionnel
  • ✓Conditions : =, <, >, ≤, ≥, ≠

4Pieges a eviter (2)

  • ✗Confondre = (égalité) et ← (affectation)
    ✓Dans une condition, = teste l'égalité
  • ✗Oublier le Sinon
    ✓Sans Sinon, rien ne se passe si la condition est fausse
Frequence au brevet :8/10 ans (80%)
AlloBrevet.fr • Fiche generee automatiquement
Ketty