-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCombinations.java
More file actions
24 lines (23 loc) · 802 Bytes
/
Combinations.java
File metadata and controls
24 lines (23 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package oopslab4;
import java.util.Scanner;
public class Combinations {
public static void main(String[] args){
System.out.println("THE DIGITS MUST LIE FROM 0-9");
Scanner sc=new Scanner(System.in);
System.out.println("ENTER FIRST DIGIT- ");
int x= sc.nextInt();
System.out.println("ENTER SECOND DIGIT- ");
int y= sc.nextInt();
System.out.println("ENTER THIRD DIGIT- ");
int z= sc.nextInt();
int lst[]={x,y,z};
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
for(int k = 0; k < 3; k++) {
if(i!=j&j!=k&k!=i)
System.out.println("POSSIBLE COMBINATION: "+lst[i]+lst[j]+lst[k]);
}
}
}
}
}