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

Kurssisisältö

Introduction to Scala

Introduction to Scala

1. Getting Started
2. Variables and Data Types
3. Conditional Statements and Loops
4. Arrays
5. Strings

book
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.

java

Main

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

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 7

Kysy tekoälyä

expand
ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

course content

Kurssisisältö

Introduction to Scala

Introduction to Scala

1. Getting Started
2. Variables and Data Types
3. Conditional Statements and Loops
4. Arrays
5. Strings

book
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.

java

Main

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

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 7
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt