Solved

# Given "n"(n>0) number of dices with "m"(m>0) sides. Print all possible combinations

Posted on 2015-02-17

Hi,

Write a Java program to print all possible combinations in below case

"n"(n>0) number of dices with "m"(m>0) sides. Print all possible combinations

for example.

2 dices with 3 sides should print out this

(1,1)

(1,2)

(1,3)

(2,1)

(2,2)

(2,3)

(3,1)

(3,2)

(3,3)

I gave it a sincere try before posting this. My code doesn't work if number of dices is more than 2 which is not right. Thanks in advance for looking.