write a menu driven program in Java to print all the unique number from 100 to 1000..
[unique number means digits are not repeated]
Answers
Answered by
1
Answer:
Java code
Explanation:
import java.util.Scanner;
public class Exercise39 {
public static void main(String[] args) {
int amount = 0;
for(int i = 1; i <= 4; i++){
for(int j = 1; j <= 4; j++){
for(int k = 1; k <= 4; k++){
if(k != i && k != j && i != j){
amount++;
System.out.println(i + "" + j + "" + k);
}
}
}
}
System.out.println("Total number of the three-digit-number is " + amount);
}
}
Similar questions
English,
3 months ago
English,
3 months ago
Computer Science,
7 months ago
English,
7 months ago
English,
1 year ago