MIT-Curricular/OOP/Java/Lab/Week3/LadderForEach.java

15 lines
304 B
Java
Raw Normal View History

2024-08-10 09:47:35 +05:30
public class LadderForEach {
public static void main(String args[]){
int[] array = {1,2,3,4,5};
for(int i: array){
for (int j = 0; j<i; j++){
System.out.print(i+" ");
}
System.out.println("");
}
}
}