Challenge: Nesting in Loops
Task
Create a for loop using to
and print only even numbers from 2
to 10
inclusive using a nested if statement.
Main.java
123456789object Main { def main(args: Array[String]): Unit = { for ___ { if ___ { // Check if i is even ___ // Print the value of i } } } }
Tout était clair ?
Merci pour vos commentaires !
Section 3. Chapitre 7
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Suggested prompts:
Posez-moi des questions sur ce sujet
Résumer ce chapitre
Afficher des exemples du monde réel
Awesome!
Completion rate improved to 2.86
Challenge: Nesting in Loops
Glissez pour afficher le menu
Task
Create a for loop using to
and print only even numbers from 2
to 10
inclusive using a nested if statement.
Main.java
123456789object Main { def main(args: Array[String]): Unit = { for ___ { if ___ { // Check if i is even ___ // Print the value of i } } } }
Tout était clair ?
Merci pour vos commentaires !
Section 3. Chapitre 7