Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Nesting in Loops | Conditional Statements and Loops
Introduction to Scala

bookChallenge: 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

Main.java

copy
123456789
object Main { def main(args: Array[String]): Unit = { for ___ { if ___ { // Check if i is even ___ // Print the value of i } } } }

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 7

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Pregunte me preguntas sobre este tema

Resumir este capítulo

Mostrar ejemplos del mundo real

Awesome!

Completion rate improved to 2.86

bookChallenge: Nesting in Loops

Desliza para mostrar el menú

Task

Create a for loop using to and print only even numbers from 2 to 10 inclusive using a nested if statement.

Main.java

Main.java

copy
123456789
object Main { def main(args: Array[String]): Unit = { for ___ { if ___ { // Check if i is even ___ // Print the value of i } } } }

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 7
some-alt