Print Shape Number in Java

preview_player
Показать описание
#BackCoding

Java program enhances the coding skill, logic, and looping concepts. It is mostly asked in Java interview to check the logic and thinking of the programmer. We can print a Java pattern program in different designs.a pattern program, we must have a deep knowlede.

Each program has two or more than two loops. The number of the loop depends on the complexity of pattern or logic. The first for loop works for the row and the second loop works for the column. In the pattern programs, Java for loop is widely used.

#programming
#java
#dcoder
#shorts
Рекомендации по теме
Комментарии
Автор

public class NumberPatternPrint{

public static void numberPrint(){

int n=10;
for(int i=1;i<=n;i++){
for(int j=1;j<i;j++){
System.out.print(" ");
}
for(int h=i;h<=n;h++){
System.out.print(h+" ");
}
System.out.println();
}
for(int i=n-1;i>1;i--){
for(int j=1;j<i;j++){
System.out.print(" ");
}
for(int k=i;k<=n;k++){
System.out.print(k+" ");
}
System.out.println();
}
}

public static void main(String ar[]){


}
}

BackCoding
Автор

It was a great humiliating pattern thanks

Sigma_Diry
join shbcf.ru