Kursinhalt
Introduction to Scala
Introduction to Scala
3. Conditional Statements and Loops
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
object Main { def main(args: Array[String]): Unit = { for ___ { if ___ { // Check if i is even ___ // Print the value of i } } } }
War alles klar?
Danke für Ihr Feedback!
Abschnitt 3. Kapitel 7