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 Pattern4 #4

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

Submit Pattern4 #4

ErSKS opened this issue Jul 27, 2017 · 24 comments

Comments

@ErSKS
Copy link
Owner

ErSKS commented Jul 27, 2017

pattern4

@milan604
Copy link

Pattern 4
package pattern4;

/**
*

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

    /**

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

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

      }
      }

}

Output
screenshot from 2017-07-27 13-54-43

@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 javaapplication15;

/**
*

  • @author Kishorr
    */
    public class JavaApplication15 {

    /**

    • @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; j++){
      if(j < i){
      System.out.printf(" ");
      } else {
      System.out.printf("*");
      }
      }
      System.out.println("");
      }
      }

}
capture4

@jagdish4249
Copy link

package pattern7;

/**
*

  • @author jagdish
    */
    public class Pattern7 {

    /**

    • @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; j++) {
       if(i>j)
           System.out.print(" ");
       else
           System.out.print("*");
      
       }
      

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

}

image

@pujanchangubhari73
Copy link

package forpattern6.java;

/**
*

  • @author Balkrsihna
    */
    public class ForPattern6Java {

    /**

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

       for (int a = 1; a <= i; a++) {
      
           System.out.printf(" ");
       }
       for (int j = 1; j <= (n + 1) - i; j++) {
      
           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 pattern5;

/**
*

  • @author admin
    */
    public class Pattern5 {

    /**

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

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

      }
      }

}
capture

@sajanbasnet75
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 assignment2;
/*
*

@author LORDsajan
*/
public class Assignment2 {

/**

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

        System.out.println(" ");
    }

}
}
5

@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 pattern5;

/**
*

  • @author Anish
    */
    public class Pattern5 {

    /**

    • @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>=i) {
      System.out.print(" * ");
      } else {
      System.out.print(" ");
      }
      }
      System.out.println("");
      }
      }
      }
      p5

@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 patterntwo;

/**
*

  • @author dell
    */
    public class PatternFive {

    public static void main(String[] args) {
    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
4

@ghost
Copy link

ghost commented Jul 27, 2017

package pattfive;

/**
*

  • @author User
    */
    public class PattFive {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      for (int i = 1; i <= 5; 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:
      patt5

@kajalmaharjan
Copy link

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

image

@rabina12
Copy link

System.out.println("-------Pattern 6----------------------");
for (int i = 0; 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("");
}
2

@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 star5;

/**
*

  • @author DELL
    */
    public class Star5 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      int a=0;
      for (int i = 5; i >=1; 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;        
      

      }
      }

}

OUTPUT
5

@rituratnam
Copy link

CODE:
package pattern5;

/**
*

  • @author Lavalesh
    */
    public class Pattern5 {

    /**

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

    System.out.println("");
    }
    }
    }
    Output:
    pattern5

@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 pattern4;

/**
*

  • @author NiiRosh
    */
    public class Pattern4 {

    /**

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

       }
       for (int j = 4; j >= i; j--) {
           System.out.printf("*");
      
       }
       System.out.println("");
      

      }
      }

}
Output:
pattern4

@duwalshraddha
Copy link

Code
package pattern5;

/**
*

  • @author Lenovo
    */
    public class Pattern5 {

    /**

    • @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 = 4; j >= 6 - i; j--) {
      System.out.print(" ");
      }
      for (int j = 1; j <= 6 - i; j++) {
      System.out.print("
      ");
      }
      System.out.println("");
      }
      }

}
4

@Rajjushrestha
Copy link

public static void main(String[] args) {
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");
    }

4

@sanzeevtamang
Copy link

Code:
package pattern5;

/**
*

  • @author Eev
    */
    public class PatterN5 {

    /**

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

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

      }
      }

}

Output:
image

@Roshanshrestha7
Copy link

public class Ass4 {

/**
 * @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 k = 0; k < i; k++) {
                System.out.print("*");
            
        }
        System.out.print("\n");
    }

// 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 k = 1; k <= i; k++) {
      System.out.print(" ");
      }
      for (int j = i; j <= 5; j++) {
      System.out.print("
      ");
      }
      System.out.print("\n");
      }
      }
      Output:
      5

@ajay987
Copy link

ajay987 commented Jul 29, 2017

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();
}
patt4sol

@sarumdr
Copy link

sarumdr 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 pattern5;

/**
*

  • @author sarumdr
    */
    public class Pattern5 {

    /**

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

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

      }
      }

}
pattern5

@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 pat5;

/**
*

  • @author nissus
    */
    public class Pat5 {

    /**

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

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

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

System.out.println("");
}

    // TODO code application logic here
}

}
pat5

@luckydivya
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 pattren4.pkg1;

/**
*

  • @author PC
    */
    public class Pattren41 {

    /**

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

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

      }
      output
      pattern4

@ragenmah
Copy link

package pattern4;

/**
*

  • @author ragen
    */
    public class Pattern4 {

    /**

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

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

      }
      }

}

fullscreen capture 7312017 52443 pm

@ErSKS ErSKS closed this as completed Aug 2, 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