Menu Bar

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Showing posts with label Java Pattern Programs. Show all posts
Showing posts with label Java Pattern Programs. Show all posts

Sunday, 30 April 2017

Java Number Pattern Printing Program #21



 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
32
33
34
35
36
37
38
39
40
41
public class NumberPrinting_21 {
 
 public static void main(String[] args) {
  int rows = 4;
  
  int n = 1;
  for(int i=0;i<rows;i++){
   for(int j=0;j<=i;j++){
    System.out.print(n+" ");
   }
   for(int k=rows-1;k>i;k--){
    System.out.print("0 ");
   }
   for(int l=rows-1;l>i;l--){
    System.out.print("0 ");
   }
   for(int m=0;m<=i;m++){
    System.out.print(n+" ");
   }
   n = n+2;
   System.out.println();
  }
  n = n - 4;
  for(int i=0;i<rows-1;i++){
   for(int j=rows-1;j>i;j--){
    System.out.print(n+" ");
   }
   for(int k=0;k<=i;k++){
    System.out.print("0 ");
   }
   for(int l=0;l<=i;l++){
    System.out.print("0 ");
   }
   for(int m=rows-1;m>i;m--){
    System.out.print(n+" ");
   }
   n = n - 2;
   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.



Read More »

Saturday, 15 April 2017

Java Number Pattern Printing Program #20


 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
32
33
34
35
36
public class NumberPrinting_20 {
 
 public static void main(String[] args) {
  int rows = 5;
  int n = 1;
  
  for(int i=1;i<=rows;i++){
   for(int j=1;j<i;j++){
    System.out.print(" ");
   }
   for(int k=rows;k>i;k--){
    System.out.print(n);
   }
   for(int l=rows;l>=i;l--){
    System.out.print(n);
   }
   n++;
   System.out.println();
  }
  //Below Code is For Lower Half Numbers
  n = rows - 1;
  for(int i=1;i<=rows-1;i++){
   for(int j=rows-1;j>i;j--){
    System.out.print(" ");
   }
   for(int k=1;k<=i+1;k++){
    System.out.print(n);
   }
   for(int l=1;l<=i;l++){
    System.out.print(n);
   }
   n--;
   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.



Read More »

Java Number Pattern Printing Program #19


 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
32
33
34
public class NumberPrinting_19 {
 
 public static void main(String[] args) {
  int rows = 5;
  int n = 1;
  
  for(int i=1;i<=rows;i++){
   for(int j=rows;j>i;j--){
    System.out.print(" ");
   }
   int k=0;
   for(;k<i;k++){
    System.out.print(n);
    n--;
   }
   n = k +1;
   System.out.println();
  }
  //Below Code is For Lower Half Numbers
  n = rows-1;
  for(int i=1;i<=rows;i++){
   for(int j=1;j<=i;j++){
    System.out.print(" ");
   }
   int k=rows;
   for(;k>i;k--){
    System.out.print(n);
    n--;
   }
   n = rows - k-1;
   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.



Read More »

Friday, 14 April 2017

Java Number Pattern Printing Program #18


 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
public class NumberPrinting_18 {
 public static void main(String[] args) {
  int rows = 5;
  int n = 1;
  
  for(int i=1;i<=rows;i++){
   for(int j=1;j<=i;j++){
    System.out.print(j);
   }
   for(int k=rows;k>i;k--){
    System.out.print(" ");
   }
   for(int l=rows;l>i;l--){
    System.out.print(" ");
   }
   int m=0;
   for(;m<i;m++){
    System.out.print(n);
    n--;
   }
   n = m + 1;
   System.out.println();
  }
  //Below Code is for Lower Half Numbers
  n = 1;
  int z = rows-1;
  for(int i=1;i<=rows;i++){
     for(int j=rows;j>i;j--){
       System.out.print(n);
       n++;
     }
     for(int k=0;k<i;k++){
       System.out.print(" ");
     }
     for(int l=0;l<i;l++){
       System.out.print(" ");
     }
     int m = rows;
     for(;m>i;m--){
       System.out.print(z);
       z--;
     }
     n = 1;
     z = rows-m-1;
     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.



Read More »

Java Number Pattern Printing Program #17


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class NumberPrinting_17 {
 
 public static void main(String[] args) {
  int rows = 5;
  int n = 1;
  
  for(int i=1;i<=rows;i++){
   for(int j=rows;j>=i;j--){
    System.out.print(n);
    n++;
   }
   n = 1;
   System.out.println();
  }
  //Below Code is for Lower Half Numbers
  for(int i=1;i<rows;i++){
   for(int j=1;j<=i+1;j++){
    System.out.print(j);
   }
   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.



Read More »

Java Number Pattern Printing Program #16


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
public class NumberPrinting_16 {
 public static void main(String[] args) {
  int rows = 5;
  
  for(int i=1;i<=rows;i++){
   for(int j=1;j<=i;j++){
    System.out.print(j);
   }
   System.out.println();
  }
  //Below Code is for Lower Half Numbers
  int n = 1;
  for(int i=1;i<=rows;i++){
   for(int j=rows;j>i;j--){
    System.out.print(n);
    n++;
   }
   n = 1;
   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.



Read More »

Thursday, 13 April 2017

Java Alphabets Pattern Printing Program #4


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
public class AlphabetsPrinting_4 {
 
 public static void main(String[] args) {
  char rows = 'G';

  for(char i='A';i<rows;i++){
   for(char j=rows;j>i+1;j--){
    System.out.print(" ");
   }
   for(char k='A';k<=i;k++){
    System.out.print(k);
   }
   for(char l='A';l<i;l++){
    System.out.print(l);
   }
   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.



Read More »

Thursday, 6 April 2017

Java Number Pattern printing Program #14


 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
public class NumberPrinting_14 {
 
 public static void main(String[] args) {
  int rows = 7;
  int n = 1;
  int z = rows;
  
  for(int i=0;i<rows;i++){
   for(int j=rows;j>i;j--){
    System.out.print(n);
    n++;
   }
   for(int k=0;k<i;k++){
    System.out.print(" ");
   }
   for(int l=0;l<i;l++){
    System.out.print(" ");
   }
   int m = rows;
   for(;m>i;m--){
    System.out.print(z);
    z--;
   }
   n=1;
   z = rows-m-1;
   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.



Read More »

Java Number Pattern Printing Program #13


 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
public class NumberPrinting_13 {
 
 public static void main(String[] args) {
  int rows = 5;
  int n = 1;
  int z = 1;
  
  for(int i=0;i<rows;i++){
   for(int j=0;j<=i;j++){
    System.out.print(n);
    n++;
   }
   for(int k=rows;k>i+1;k--){
    System.out.print(" ");
   }
   for(int k=rows;k>i+1;k--){
    System.out.print(" ");
   }
   int j=0;
   for(;j<=i;j++){
    System.out.print(z);
    z--;
   }
   n=1;
   z = j+1;
   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.



Read More »

Monday, 3 April 2017

Java Number Pattern Printing Program #12


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
public class NumberPrinting_12 {
 
 public static void main(String[] args) {
  int rows = 5;
  int n = 1;
  for(int i=0;i<rows;i++)
  {
   for(int j=0;j<=i;j++)
   {
    System.out.print(n+" ");
    n+=2;
   }
   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.



Read More »

Java Number Pattern Printing Program #11


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
public class NumberPrinting_11 {
 
 public static void main(String[] args) {
  int rows = 8;
  
  for(int i=0;i<rows;i++)
  {
   for(int j=rows;j>=1;j--)
   {
    System.out.print(j); 
   }
   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.



Read More »