Upload files to "OOP/Java/Lab/Week3"

This commit is contained in:
Aadit Agrawal 2024-08-10 11:20:04 +05:30
parent d7432df050
commit 490ff117eb
3 changed files with 74 additions and 27 deletions

View file

@ -0,0 +1,37 @@
public class FourNumberGen {
public static void main(String args[]){
int i,j,k,l;
System.out.println("With Repetition: ");
for(i = 0; i<=9; i++){
for(j = 0; j<=9; j++){
for(k = 0; k<=9; k++){
for(l = 0; l<=9; l++)
{
System.out.print(i+""+j+""+k+""+l+" ");
}
}
}
}
for(i=0;i<10;i++){
System.out.println(" ");
}
System.out.println("Without Repetition: ");
for(i = 0; i<=9; i++){
for(j = 0; j<=9; j++){
for(k = 0; k<=9; k++){
for(l = 0; l<=9; l++)
{
if((i!=j)&(i!=k)&(i!=l)&(j!=k)&(j!=l)&(k!=l)){
System.out.print(i+""+j+""+k+""+l+" ");
}
}
}
}
}
}
}