Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class patt3{
- public static void main(String[] args) {
- int i,k,j,n=5;
- for (i= 0; i<= n-1 ; i++)
- {
- for (j=0; j<i; j++)
- {
- System.out.print(" ");
- }
- for (k=i; k<=n-1; k++)
- {
- System.out.print("*" + " ");
- }
- System.out.println("");
- }
- for (i= n-1; i>= 0; i--)
- {
- for (j=0; j<i; j++)
- {
- System.out.print(" ");
- }
- for (k=i; k<=n-1; k++)
- {
- System.out.print("*" + " ");
- }
- System.out.println("");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement