
54321 4321 321 21 1 using for loop or nested 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 using for loop or nested 1 135 1357 1359
10 8 6 4 2 0 8 6 4 2 0 6 4 2 0 2 1 0
1 2 3 3 4 5 4 5 6 7 5 6 7 8 9 6 7 8 9 10 all for loop code plz friends guide me

Java Number Patterns
54321
4321
321
21
1
public class PatternExample{
public static void main(String[] args){
for (int i = 5; i >= 1; i--) {
for (int j = i; j > 0; j--) {
System.out.print("" + j);
}
System.out.println("");
}
}
}

Java Number Pattern
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
public class PatternExample{
public static void main(String[] args){
for(int i=1;i<=5;i++){
for(int j=1;j<i+1;j++){
System.out.print(j);
}
System.out.println();
}
for (int i = 5; i >= 1; i--) {
for (int j = i; j > 0; j--) {
System.out.print("" + j);
}
System.out.println("");
}
}
}

Java Number Pattern
1
13
135
1357
13579
public class PatternExample{
public static void main(String[] args){
for(int i=1;i<=10;i++){
if(i%2!=0){
for(int j=1;j<i+1;j+=2){
System.out.print(j);
}
System.out.println();
}
}
}
}

Java Number Pattern
10 8 6 4 2 0
8 6 4 2 0
6 4 2 0
2 1
0
public class PatternExample{
public static void main(String[] args){
for (int i = 10; i >= 0; i--) {
if(i%2==0){
for (int j = i; j >= 0; j-=2) {
System.out.print(" " + j);
}
System.out.println("");
}
}
}
}

1 1 2 3 1 2 3 4 1 2 3 4 5
for loop this program in java

thanks friend rely the answer
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.