Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit Pattern5 #5

Closed
ErSKS opened this issue Jul 27, 2017 · 26 comments
Closed

Submit Pattern5 #5

ErSKS opened this issue Jul 27, 2017 · 26 comments

Comments

@ErSKS
Copy link
Owner

ErSKS commented Jul 27, 2017

pattern5

@milan604
Copy link

milan604 commented Jul 27, 2017

package pattern19;

/**
*

  • @author m-lan
    */
    public class Pattern19 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      for (int i = 0; i < 4; i++) {
      for (int j = 3; j > i; j--) {
      System.out.printf(" ");
      }
      for (int k = 0; k <= i; k++) {
      System.out.printf("
      ");
      }
      System.out.println("");
      }
      for (int i = 0; i < 3; i++) {
      for (int j = 0; j <= i; j++) {
      System.out.printf(" ");
      }
      for (int k = 3; k > i; k--) {
      System.out.printf("*");
      }
      System.out.println("");
      }
      }

}

Output
screenshot from 2017-07-27 14-00-33

@raBbn
Copy link

raBbn commented Jul 27, 2017

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package pattern21;

/**
*

  • @author Kishorr
    */
    public class Pattern21 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      // TODO code application logic here
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5; j++) {
      if (j < 5 - i) {
      System.out.print(" ");
      } else {
      System.out.print("
      ");
      }

       }
       System.out.println("");
      

      }
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5; j++) {
      if (j < i) {
      System.out.print(" ");
      } else {
      System.out.print("* ");
      }
      }
      System.out.println("");
      }
      }
      }
      capture5

@jagdish4249
Copy link

package pattern18;

/**
*

  • @author jagdish
    */
    public class Pattern18 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic here

      for (int i = 4; i >= 1; i--) {
      for (int j = 1; j <= 4; j++) {
      if(i<=j)
      System.out.print("*");
      else
      System.out.print(" ");
      }
      System.out.println("");

      }
      for (int i = 1; i <= 3; i++) {
      for (int j = 1; j <= 4; j++) {
      if(i<j){
      System.out.print("*");
      }else{
      System.out.print(" ");
      }

       }
       System.out.println("");
      

      }

    }

}

image

@pujanchangubhari73
Copy link

package forpattern30;

/**
*

  • @author Balkrsihna
    */
    public class ForPattern30 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      int n = 5;
      for (int i = 1; i <= n; i++) {

       for (int j = 1; j <= n - i; j++) {
      
           System.out.printf(" ");
      
       }
       for (int a = 1; a <= i; a++) {
           System.out.print("*");
       }
       System.out.printf("\n");
      

      }

      for (int m = 1; m <= n - 1; m++) {
      for (int k = 1; k <= m; k++) {

           System.out.printf(" ");
      
       }
       for (int l = n - 1; l >= m; l--) {
           System.out.print("*");
       }
       System.out.printf("\n");
      

      }
      }

}

image

@sthaanu
Copy link

sthaanu commented Jul 27, 2017

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package pattern10;

/**
*

  • @author admin
    */
    public class Pattern10 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      for (int i = 0; i < 6; i++) {
      for (int j = 0; j <= 5 - i; j++) {
      System.out.print(" ");
      }
      for (int k = 0; k < i; k++) {
      System.out.print("
      ");
      }
      System.out.print("\n");
      }
      for (int i = 0; i < 5; i++) {
      for (int m = 0; m <= i; m++) {
      System.out.print(" ");
      }
      for (int n = 0; n < 5 - i; n++) {
      System.out.print("*");

       }
       System.out.print("\n");
      

      }

    }

}
capture

@sajanbasnet75
Copy link

sajanbasnet75 commented Jul 27, 2017

/*

To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
/
package assignment2;
/*
*

@author LORDsajan
*/
public class Assignment2 {

/**

@param args the command line arguments
/
public static void main(String[] args) {
// pattern10
System.out.println("\nPattern10");
for (int i = 1; i <= 9; i++) {
if (i <= 5) {
for (int k = 1; k <= 5 - i; k++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
} else {
for (int l = 6; l <= i; l++) {
System.out.print(" ");
}
for (int m = i; m <= 9; m++) {
System.out.print(" * ");

            }
        }
        System.out.println(" ");
    }

}
}
10

@karmi214
Copy link

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package pattern10;

/**
*

  • @author Anish
    */
    public class Pattern10 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic here
      for (int i = 5; i > 0; i--) {
      for (int j = 0; j < 5; j++) {
      if (j<i-1) {
      System.out.printf(" ");
      } else {
      System.out.printf(" * ");
      }
      }

       System.out.println("");
      

      }
      for (int i = 1; i < 5; i++) {
      for (int j = 0; j < 5; j++) {
      if (j>=i) {
      System.out.print(" * ");
      } else {
      System.out.printf(" ");
      }
      }
      System.out.println("");
      }
      }

}
p10

@syslin
Copy link

syslin commented Jul 27, 2017

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package daytwo;

/**
*

  • @author dell
    */
    public class DayTwo {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic here

      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5 - i; j++) {
      System.out.print(" ");
      }
      for (int k = 0; k < i; k++) {
      System.out.print("*");
      }
      System.out.println();
      }
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < i; j++) {
      System.out.print(" ");

       }
       for (int k = 5; k > i; k--) {
           System.out.print("*");
      
       }
       System.out.println();
      

      }

    }
    }
    output
    5

@kajalmaharjan
Copy link

//PATTERN 14
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5 - i; j++) {
            System.out.printf(" ");
        }
        for (int j = 0; j < i; j++) {
            System.out.printf("*");
        }
        System.out.println();
    }
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < i; j++) {
            System.out.printf(" ");
        }
        for (int j = 5; j > i; j--) {
            System.out.printf("*");
        }
        System.out.println();
    }

image

@rabina12
Copy link

  • @author Albina Praz
    */
    public class P19 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      // TODO code application logic here
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5 - i; j++) {
      System.out.printf(" ");
      }
      for (int j = 0; j < i; j++) {
      System.out.printf("
      ");
      }
      System.out.println();
      }
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < i; j++) {
      System.out.printf(" ");
      }
      for (int j = 5; j > i; j--) {
      System.out.printf("*");
      }
      System.out.println();
      }
      }

}
19

@RakenShahi
Copy link

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package q19;

/**
*

  • @author DELL
    */
    public class Q19 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      int a = 4;
      for (int i = 1; i <= 4; i++) {

       for (int k = 0; k < a; k++) {
           System.out.printf(" ");
       }
      
       for (int j = 0; j < i; j++) {
           System.out.printf("*");
       }
      
       System.out.print("\n");
       a = a - 1;
      

      }

      int b = 2;
      for (int i = 3; i >= 1; i--) {

       for (int k = 0; k < b; k++) {
           System.out.printf(" ");
       }
      
       for (int j = 0; j < i; j++) {
           System.out.printf("*");
       }
      
       System.out.print("\n");
       b = b + 1;
      

      }
      }

}

OUTPUT
19

@rivab
Copy link

rivab commented Jul 27, 2017

for (int i = 0; i < 5; i++) {

        for (int j = 0; j < 4 - i; j++) {
            System.out.print(" ");
        }
        for (int k = 5; k > 4 - i; k--) {
            System.out.print("*");

        }
        System.out.println("");
    }

    for (int i = 0; i < 4; i++) {
        for (int j = 0; j <= i; j++) {
            System.out.print(" ");

        }
        for (int k = 4; k > i; k--) {
            System.out.print("*");

        }
        System.out.println("");

    }

10

@Roshantwanabasu
Copy link

Code:
/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package verticaltriangle;

/**
*

  • @author NiiRosh
    */
    public class Verticaltriangle {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic

      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5; j++) {
      if (j < 5 - i) {
      System.out.print(" ");
      } else {
      System.out.print("");
      }
      }
      System.out.println("");
      }
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5; j++) {
      if (j < i) {
      System.out.print(" ");
      } else {
      System.out.print("
      ");
      }
      }
      System.out.println("");
      }
      }

}
Output:
pattern5

@kiir33
Copy link

kiir33 commented Jul 27, 2017

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package pattern2;

/**
*

  • @author KIRANN
    */
    public class Pattern2 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      // TODO code application logic here
      System.out.println("\nPattern 5\n----------------------");
      for (int i = 0; i < 5; i++) {
      for (int j = 5; j > i; j--) {
      System.out.print(" ");
      }
      for (int j = 0; j <= i; j++) {
      System.out.print("
      ");
      }
      System.out.println("");
      }
      for (int i = 1; i < 5; i++) {
      for (int j = 0; j <= i; j++) {
      System.out.print(" ");
      }
      for (int j = 5; j > i; j--) {
      System.out.print("*");
      }
      System.out.println("");
      }

    }
    }

Output:
capture

@leoprabin10
Copy link

System.out.println("\n\n\n");
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
if (j < 5 - i) {
System.out.print(" ");
} else {
System.out.print("* ");
}
}
System.out.println("");
}
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
if (j < i) {
System.out.print(" ");
} else {
System.out.print("* ");
}
}
System.out.println();
}

    // TODO code application logic here
}

}
p19

@Rajjushrestha
Copy link

public static void main(String[] args) {
// TODO code application logic here
for (int i = 0; i < 4; i++) {
for (int j = 4; j > i; j--) {
System.out.print(" ");
}
for (int k = 0; k <= i; k++) {
System.out.print("*");
}
System.out.println(" ");
}

    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < i; j++) {
            System.out.print(" ");
        }
        for (int k = 5; k > i; k--) {
            System.out.print("*");
        }

        System.out.print("\n");
    }

}

}
5

@sanzeevtamang
Copy link

Code:
// patern 10
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= 5 - i; j++) {
System.out.print(" ");

        }
        for (int k = 0; k < i; k++) {
            System.out.print("*");
        }
        System.out.println();
    }

    for (int i = 1; i <= 5; i++) {
        for (int j = 1; j <= i; j++) {
            System.out.print(" ");

        }
        for (int k = 5; k > i; k--) {
            System.out.print("*");
        }
        System.out.println();

    }

Output:
image

@ghost
Copy link

ghost commented Jul 28, 2017

package patt10;

/**
*

  • @author User
    */
    public class Patt10 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      for (int i = 1; i <= 6; i++) {
      for (int j = 4; j >= i - 1; j--) {
      System.out.print(" ");
      }
      for (int k = 2; k <= i; k++) {
      System.out.print("
      ");
      }
      System.out.println(" ");
      }
      for (int i = 2; i < 6; i++) {
      for (int j = 1; j <= i - 1; j++) {
      System.out.print(" ");
      }
      for (int k = 5; k >= i; k--) {
      System.out.print("*");
      }
      System.out.println(" ");
      }
      }
      Output:
      patt10

@Roshanshrestha7
Copy link

public class Ass19 {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5 - i; j++) {
            System.out.print(" ");
        }
        for (int j = 0; j < i; j++) {
            System.out.print("*");
        }
        System.out.println("");
    }
    for (int i = 2; i < 5; i++) {
        for (int j = 0; j < i; j++) {
            System.out.print(" ");
        }
        for (int j = 0; j < 5 - i; j++) {
            System.out.print("*");
        }
        System.out.println("");
    }
    // TODO code application logic here
}

}
image

@Sudan15423
Copy link

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package day3;

/**
*

  • @author dragon15423
    */
    public class Day3 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      for (int i = 1; i <= 5; i++) {
      for (int j = i; j <= 5; j++) {
      System.out.print(" ");
      }
      for (int j = 1; j <= i; j++) {
      System.out.print("
      ");
      }
      System.out.println();
      }
      for (int i = 1; i <= 5; i++) {
      for (int k = 1; k <= i + 1; k++) {
      System.out.print(" ");
      }
      for (int j = i; j < 5; j++) {
      System.out.print("*");
      }
      System.out.println();
      }
      }
      Output:
      10

@rituratnam
Copy link

CODE:
package pattern10;

/**
*

  • @author Lavalesh
    */
    public class Pattern10 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5 - i; j++) {
      System.out.printf(" ");
      }
      for (int j = 0; j < i; j++) {
      System.out.printf("
      ");
      }
      System.out.println();
      }
      for (int i = 0; i < 5; i++) {
      for (int j = 0; j < i; j++) {
      System.out.printf(" ");
      }
      for (int j = 5; j > i; j--) {
      System.out.printf("*");
      }
      System.out.println();
      }
      }
      }
      Output:
      pattern10

@ajay987
Copy link

ajay987 commented Jul 29, 2017

for (int i = 0; i < 5; i++) {
for (int j = 4; j > i; j--) {
System.out.print(" ");
}
for (int k = 0; k <= i; k++) {
System.out.print("")
}
System.out.println();
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j <= i; j++) {
System.out.print(" ");
}
for (int k = 4; k > i; k--) {
System.out.print("
");
}
System.out.println();
}
patt5sol

@duwalshraddha
Copy link

Code
public class Pattern19 {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    // TODO code application logic here
    for (int i = 1; i <= 5; i++) {
        for (int j = 1; j <= 5 - i; j++) {
            System.out.print(" ");
        }

        for (int j = 5; j >= 6 - i; j--) {
            System.out.print("*");
        }
        System.out.println("");
    }
    for (int i = 2; i <= 5; i++) {
        for (int j = 1; j < i; j++) {
            System.out.print(" ");
        }
        for (int j = 1; j <= 6 - i; j++) {
            System.out.print("*");
        }
        System.out.println("");
    }
}

}
19

@SusanCB
Copy link

SusanCB commented Jul 29, 2017

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package pat19;

/**
*

  • @author nissus
    */
    public class Pat19 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic here

for (int i = 4; i >= 1; i--) {
for (int j = 1; j <= 4; j++) {
if(i<=j)
System.out.print("*");
else
System.out.print(" ");
}
System.out.println("");

}
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 4; j++) {
if(i<j){
System.out.print("*");
}else{
System.out.print(" ");
}

}
System.out.println("");
}

}

}
pat19

@luckydivya
Copy link

System.out.println("\nPattern10");
for (int i = 1; i <= 9; i++) {
if (i <= 5) {
for (int k = 1; k <= 5 - i; k++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
} else {
for (int l = 6; l <= i; l++) {
System.out.print(" ");
}
for (int m = i; m <= 9; m++) {
System.out.print(" * ");

            }
        }
        System.out.println(" ");
    }
}

}
}

}
output
pattern5

@ragenmah
Copy link

package pattern5;

/**
*

  • @author ragen
    */
    public class Pattern5 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      for (int i = 0; i < 4; i++) {
      for (int j = 3; j > i; j--) {
      System.out.printf(" ");
      }
      for (int k = 0; k <= i; k++) {
      System.out.printf("
      ");
      }
      System.out.println("");
      }
      for (int i = 0; i < 3; i++) {
      for (int j = 0; j <= i; j++) {
      System.out.printf(" ");
      }
      for (int k = 3; k > i; k--) {
      System.out.printf("*");
      }
      System.out.println("");
      }
      }

}
fullscreen capture 7312017 53025 pm

@ErSKS ErSKS closed this as completed Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests