Menu Bar

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday, 30 March 2017

Java Number Pattern Printing Program #7


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class NumberPrinting_7 {
 
 public static void main(String[] args) {
  int rows = 5;
  
  for(int i=0;i<rows;i++){
   for(int j=rows;j>i;j--){
    System.out.print(" ");
   }
   for(int k=0;k<=i;k++){
    System.out.print(i);
   }
   for(int l=0;l<i;l++){
    System.out.print(i);
   }
   System.out.println();
  }
  for(int i=1;i<rows;i++){
   for(int j=0;j<=i;j++){
    System.out.print(" ");
   }
   for(int k=rows;k>i;k--){
    System.out.print(i);
   }
   for(int l=rows;l>i+1;l--){
    System.out.print(i);
   }
   System.out.println();
  }
 }
}



      
Blog Author - Pushkar Khosla,
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.

This blog is all about to learn Core Java ,Interview Programs and Coding tricks to polish your Java Knowledge. If you like the content of this blog please share this with your friends.



Share this Blog with yours Friends !!

No comments:

Post a Comment