SCALA BASICS AND PYTHON CODING EXAMPLES: PROGRAMMING FOR BEGINNERS by KING J

SCALA BASICS AND PYTHON CODING EXAMPLES: PROGRAMMING FOR BEGINNERS by KING J

Author:KING, J [KING, J]
Language: eng
Format: epub
Published: 2021-08-01T00:00:00+00:00


EXAMPLE

// Scala program to illustrate for loop

object forloopDemo {

// Main Method

def main(args: Array[String]) {

var y = 0;

// for loop execution with range

for(y <- 1 to 7)

{

println("Value of y is: " + y);

}

}

}

Output:

Value of y is: 1

Value of y is: 2

Value of y is: 3

Value of y is: 4

Value of y is: 5

Value of y is: 6

Value of y is: 7

Nested Loops

The loop inside a loop which contains a loop is known as the nested loop.

It may contain a while loop inside a while loop or



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.