Défi : Vérifier si un Nombre est Pair et Positif
Tâche
Swipe to start coding
Écrire un programme qui vérifie si un nombre donné est pair et positif.
- Utiliser une instruction
if
avec l'opérateur&&
pour vérifier si num est :- Supérieur à 0.
- Pair (divisible par 2).
- Si les deux conditions sont
true
, afficher :"The number is positive and even."
. - Sinon, afficher :
"The number does not meet the criteria."
.
Solution
Tout était clair ?
Merci pour vos commentaires !