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 Pattern6 #6

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

Submit Pattern6 #6

ErSKS opened this issue Jul 27, 2017 · 25 comments

Comments

@ErSKS
Copy link
Owner

ErSKS commented Jul 27, 2017

pattern6

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

/**
*

  • @author Kishorr
    */
    public class JavaApplication25 {

    /**

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

           }
           else
           {
            if(j%2==1)
           System.out.print(" ");
           else
               System.out.print("*");
      
           }
       }
       System.out.println("");
      

      }
      }

}
capture6

@milan604
Copy link

package pattern7;

/**
*

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

    /**

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

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

      }

    }
    }
    screenshot from 2017-07-27 14-46-16

@jagdish4249
Copy link

package pattern9;

/**
*

  • @author jagdish
    */
    public class Pattern9 {

    /**

    • @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{
               if((i%2==0 && j%2==0) || (i%2==1 && j%2==1) )
                   System.out.print(x);
               else
                   System.out.print(" ");
           }
       }
      
       
       for (int j = 2; j >= 1; j--) {
           if(i<=j){
             if(i%2==0 && j%2==0 || i%2==1 && j%2==1 )
               System.out.print(x);
             else
                 System.out.print(" ");
           }
           
               
           
       }
       
       
       System.out.println("");
      

      }
      }

}

image

@maheshyakami
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 pattern;

/**
*

  • @author mahesh
    */
    public class Pattern {

    /**

    • @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();
      }
      System.out.println();
      }

}
screen shot 2017-07-27 at 5 07 58 pm

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

/**
*

  • @author Anish
    */
    public class Pattern13 {

    /**

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

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

      }
      }

}
p13

@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) {
// pattern13
System.out.println("\nPattern 13");
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(" *");
}
System.out.println(" ");

    }

}
}
13

@kajalmaharjan
Copy link

//PATTERN 13
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");
}
image

@rabina12
Copy link

  • @author Albina Praz
    */
    public class P6 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic here
      System.out.println("\nPattern 13");
      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(" *");
      }
      System.out.println(" ");
      }
      }

}
pt6

@kiir33
Copy link

kiir33 commented Jul 27, 2017

System.out.println("Pattern 7\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("");
}

Output:

capture

@rivab
Copy link

rivab commented Jul 27, 2017

    System.out.println("Output of Q.No.13");        
      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("* ");
        }

System.out.println("");
}

13

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

/**
*

  • @author dell
    */
    public class Paterrn {

    /**

    • @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 = 5; j > i; j--) {
      System.out.print(" ");
      }

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

      }
      }
      }
      output
      6

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

/**
*

  • @author NiiRosh
    */
    public class Pattern6 {

    /**

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

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

      }
      }

}
Output:
pattern6

@Rajjushrestha
Copy link

public static void main(String[] args) {
for (int i = 0; i < 4; 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");
        
    }

6

@Roshanshrestha7
Copy link

public class Ass6 {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {

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

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

            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 j = 5; j >= i; j--) {
      if (i == j || i == 1) {
      System.out.print("7");
      } else {
      System.out.print(" ");
      }
      }
      System.out.println();
      }
      }
      Output:
      13

@ghost
Copy link

ghost commented Jul 29, 2017

package patternten.pkg3;

/**
*

  • @author User
    */
    public class PatternTen3 {

    /**

    • @param args the command line arguments
      /
      public static void main(String[] args) {
      int count = 1;
      int space = 3;
      for (int i = 1; i <= 3; i++) {
      for (int j = 1; j < space; j++) {
      System.out.print(" ");
      }
      for (int k = 1; k <= i; k++) {
      System.out.print("
      ");
      if (i > 1 && count < i) {
      System.out.print(" ");
      count++;
      }
      }
      System.out.println(" ");
      count = 1;
      space--;
      }
      }
      }
      patt13

@rituratnam
Copy link

CODE:
package patternn;

/**
*

  • @author Lavalesh
    */
    public class Patternn {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      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(" *");
      }
      System.out.println(" ");

    }
    }
    }
    Output:
    patternn6

@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 star.pkg7;

/**
*

  • @author DELL
    */
    public class Star7 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic here
      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 = j + 2) {
           System.out.printf("* ");
       }
      
       System.out.print("\n");
       a = a - 1;
      

      }
      }

}

OUTPUT
7

@ajay987
Copy link

ajay987 commented Jul 29, 2017

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("# ");
        }
        System.out.println();
    }

patt6sol

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

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

/**
*

  • @author sarumdr
    */
    public class Pattern10 {

    /**

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

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

      }
      }
      }

OUTPUT
image

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

/**
*

  • @author nissus
    */
    public class Pat7 {

    /**

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

}
pat7

@sanzeevtamang
Copy link

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

star space

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

/**
*

  • @author PC
    */
    public class Pattern13 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      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
pattern13

@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 = 1; i <= 3; i++) {

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

      }

    }
    }
    fullscreen capture 7312017 53321 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