How to use nested if statement in Scala

1 Answer

0 votes
object MyClass {
     def main(args: Array[String]): Unit = {
        var x = 100;
        var y = 55;
      
        if (x == 100) {
            if (y == 55) {
                println("x = 100 and y = 55");
            }
        }
    }
}
 
 
 
 
       
/*
run:
       
x = 100 and y = 55

*/

 



answered May 31, 2021 by avibootz

Related questions

2 answers 196 views
196 views asked May 31, 2021 by avibootz
1 answer 94 views
1 answer 232 views
1 answer 268 views
1 answer 147 views
147 views asked Nov 24, 2020 by avibootz
1 answer 179 views
1 answer 190 views
...