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 Pattern7 #7

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

Submit Pattern7 #7

ErSKS opened this issue Jul 27, 2017 · 24 comments

Comments

@ErSKS
Copy link
Owner

ErSKS commented Jul 27, 2017

pattern7

@milan604
Copy link

package pattern6;

/**
*

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

    /**

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

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

      }
      }

}
screenshot from 2017-07-27 14-42-19

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

/**
*

  • @author Kishorr
    */
    public class JavaApplication19 {

    /**

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

      for (i = 0; i <3; i++) {
      for (j = 3; j >i; j--) {
      System.out.print(" ");
      }
      for (j = 0; j <=i; j++) {
      System.out.print("");
      }
      for (j = 0; j <i; j++) {
      System.out.print("
      ");
      }
      System.out.println("");
      }
      }

}
capture20

@jagdish4249
Copy link

package pattern8;

/**
*

  • @author jagdish
    */
    public class Pattern8 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      // TODO code application logic here
      char x = '
      ';
      for (int i = 3; i >= 1; i--) {

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

      }

    }

}

image

@pujanchangubhari73
Copy link

package forpattern8;

/**
*

  • @author Balkrsihna
    */
    public class ForPattern8 {

    /**

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

       for(int b=2; b<=i; b++)
       {
       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 pattern12;

/**
*

  • @author admin
    */
    public class Pattern12 {

    /**

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

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

      }
      }

}
capture

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

/**
*

  • @author Anish
    */
    public class Pattern12 {

    /**

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

}
p12

@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) {
// pattern12
System.out.println("\nPattern 12");
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 4 - i; j++) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print('*');
}
for (int k = 1; k < i; k++) {
System.out.print(" * ");
}
System.out.println(" ");

    }

}
}
12

@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

      //* * pattern 12/
      for (int i = 1; i <= 5; i++) {
      for (int j = 1; j <= 5 - i; j++) {
      System.out.print(" ");
      }

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

      }
      }
      }
      output
      7

@kajalmaharjan
Copy link

//PATTERN 7
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5 - i; j++) {
System.out.printf(" ");
}
for (int k = i; k > 0; k--) {
System.out.print("");
}
for (int j = 2; j <= i; j++) {
System.out.print("
");
}

        System.out.println(" ");
    }

image

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

/**
*

  • @author KIRANN
    */
    public class Pattern3 {

    /**

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

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

      }
      }
      }

Output:
capture

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

/**
*

  • @author DELL
    */
    public class Star6 {

    /**

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

       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
6

@rabina12
Copy link

  • @author Albina Praz
    */
    public class Pt6 {

    /**

    • @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 = i; k > 0; k--) {
      System.out.print("
      ");
      }
      for (int j = 2; j <= i; j++) {
      System.out.print("*");
      }

       System.out.println(" ");
      

      }
      }

}
ptr6

@rivab
Copy link

rivab commented Jul 27, 2017

System.out.println("Output of Q.No.12");
for (int i = 0; i < 4; i++) {
for (int j = 3; j > i; j--) {
System.out.print(" ");
}
for (int k = 0; k <= i; k++) {
System.out.print("#");

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

12

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

/**
*

  • @author NiiRosh
    */
    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 <= 3; i++) {
      for (int j = 1; j <= (3 - i); j++) {
      System.out.printf(" ");
      }
      for (int k = 0; k < (2 * i - 1); k++) {
      System.out.printf("
      ");
      }

       System.out.println();
      

      }
      }

}
Output:
pattern7

@duwalshraddha
Copy link

Code
package pattern6;

/**
*

  • @author Lenovo
    */
    public class Pattern6 {

    /**

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

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

      }
      }
      }
      6

@Rajjushrestha
Copy link

public static void main(String[] args) {
for (int i = 0; i < 4; i++) {
for (int j = 3; j > i; j--) {
System.out.print(" ");

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

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

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

7

@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 <= 4; i++) {
      for (int j = i; j <= 4; j++) {
      System.out.print(" ");
      }
      for (int k = i; k >= 1; k--) {
      System.out.print(" * ");
      }
      for (int j = 2; j <= i; j++) {
      System.out.print(" * ");
      }
      System.out.println();
      }
      }
      Output:
      12

@ghost
Copy link

ghost commented Jul 29, 2017

package patterntwelve;

/**
*

  • @author User
    */
    public class PatternTwelve {

    /**

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

@rituratnam
Copy link

CODE:
package pattern12;

/**
*

  • @author Lavalesh
    */
    public class Pattern12 {

    /**

    • @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.print(" ");

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

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

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

@ajay987
Copy link

ajay987 commented Jul 29, 2017

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

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

/**
*

  • @author sarumdr
    */
    public class Pattern7 {

    /**

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

    }

}

OUTPUT
image

@sanzeevtamang
Copy link

//Pattern 12
for (int i = 1; i <= 4; i++) {
for (int j = 4; j > 0; j--) {
if (j <= i) {
System.out.print("");
} else {
System.out.print(" ");
}
}
for (int j = 2; j <= i; j++) {
System.out.print("
");
}
System.out.println("");
}
Output:
capture

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

/**
*

  • @author PC
    */
    public class Pattern12 {

    /**

    • @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 = 5; j > i; j--) {
           System.out.printf(" ");
       }
       for (int k = 0; k < i; k++) {
           System.out.printf("* ");
       }
       System.out.printf("\n");
      

      }
      }
      output
      pa12

@ragenmah
Copy link

package pattern7;

/**
*

  • @author ragen
    */
    public class Pattern7 {

    /**

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

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

      }
      }

}

Output
*
* * *


@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