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 178 views
178 views asked May 31, 2021 by avibootz
1 answer 83 views
1 answer 205 views
1 answer 242 views
1 answer 135 views
135 views asked Nov 24, 2020 by avibootz
2 answers 97 views
97 views asked Apr 8, 2025 by avibootz
1 answer 166 views
...