The Output of the following block of code | Scala Question 9

65. Output of the following block of code -

for(i <- 1 to 2){
    for(j <- 1 to 2)
        print("(" + i + "," + j + ")\t")
}
  1. (1,1) (1,1) (1,1) (1,1)
  2. (1,1) (1,2) (2,1) (2,2)
  3. (1,1) (2,2) (1,1) (2,2)
  4. None of these

Answer: B) (1,1) (1,2) (2,1) (2,2)

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.