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 Pattern13 #13

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

Submit Pattern13 #13

ErSKS opened this issue Jul 27, 2017 · 25 comments

Comments

@ErSKS
Copy link
Owner

ErSKS commented Jul 27, 2017

pattern13

@milan604
Copy link

package pattern14;

/**
*

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

    /**

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

}

screenshot from 2017-07-27 14-35-04

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

/**
*

  • @author Kishorr
    */
    public class JavaApplication30 {

    /**

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

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

    }
    }
    capture10

@jagdish4249
Copy link

package pattern13;

/**
*

  • @author jagdish
    */
    public class Pattern13 {

    /**

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

    }

}

image

@pujanchangubhari73
Copy link

package forpattern14;

/**
*

  • @author Balkrsihna
    */
    public class ForPattern14 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      for (int i = 1; i <= 4; i++) {
      for (int j = 1; j <= i; j++) {
      int b = i - j;
      if (b % 2 == 0) {
      System.out.printf("1");
      } else {
      System.out.printf("0");
      }
      }
      System.out.printf("\n");
      }
      }

}
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 pattern1010;

/**
*

  • @author mahesh
    */
    public class Pattern1010 {

    /**

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

       }
       System.out.println("");
      

      }
      }

}
screen shot 2017-07-27 at 5 17 16 pm

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

/**
*

  • @author admin
    */
    public class Pattern9 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      for (int i = 0; i < 4; i++) {
      for (int j = 0; j < i + 1; j++) {
      System.out.print(((i + j + 1) % 2) + " ");
      }
      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 pattern9;

/**
*

  • @author Anish
    */
    public class Pattern9 {

    /**

    • @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+1; j++) {
      System.out.print(((i+j+1)%2)+" ");
      }
      System.out.println("");
      }
      }

}
p9

@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) {
// pattern9
System.out.println("Pattern 9");
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= i; j++) {
if ((i % 2 == 0 && j % 2 == 0) || (i % 2 != 0 && j % 2 != 0)) {
System.out.print("1");
} else {
System.out.print("0");
}
}
System.out.println(" ");
}
}
}
9

@kiir33
Copy link

kiir33 commented Jul 27, 2017

package pattern7;

/**
*

  • @author KIRANN
    */
    public class Pattern7 {

    /**

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

}

Output:
capture

@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 NewClass {

    public static void main(String[] args) {
    for (int i = 1; i <= 5; i++) {
    for (int j = 1; j <= i; j++) {
    if ((i + j) % 2 == 0) {
    System.out.print(1);
    } else {
    System.out.print(0);
    }

         }
         System.out.println();
    
     }
    

    }

}
output:
14

@ghost
Copy link

ghost commented Jul 27, 2017

package patt9;

/**
*

  • @author User
    */
    public class Patt9 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      for (int i = 1; i <=4; i++) {
      for (int j = 1; j <=i; j++) {
      if((i+j)%2==0){
      System.out.print("1");
      }
      else{
      System.out.print("0");
      }
      }
      System.out.println(" ");
      }
      }
      Output:
      patt9

@kajalmaharjan
Copy link

//PATTERN 11
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 5; j++) {
int d = ((i + j + 1) % 2);
if (i >= j) {
System.out.printf("%d ", d);
}
}
System.out.printf("\n");
}
image

@rabina12
Copy link

  • @author Albina Praz
    */
    public class P13 {

    /**

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

@rivab
Copy link

rivab commented Jul 27, 2017

System.out.println("Output of Q.No.9");
for (int i = 0; i < 5; i++) {
for (int j = 0; j < i; j++) {
if (i % 2 == 0) {
if (j % 2 == 1) {
System.out.print(1);
} else {
System.out.print(0);
}
} else if (j % 2 == 1) {
System.out.print(0);
} else {
System.out.print(1);
}
}
System.out.print("\n");
}
9

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

/**
*

  • @author NiiRosh
    */
    public class Binarytriangle {

    /**

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

       }
       System.out.println("");
      

      }
      }

}

Output:
pattern13

@Rajjushrestha
Copy link

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

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

13

@Roshanshrestha7
Copy link

public class Day4a {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < i; j++) {
            int b = i - j;
            if (b % 2 == 0) {
                System.out.print("0");
            } else {
                System.out.print("1");
            }
        }
        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 = 1; j < i; j++) {
      if ((i + j) % 2 == 0) {
      System.out.print("0");
      } else {
      System.out.print("1");
      }
      }
      System.out.println();
      }
      }
      Output:
      9

@ajay987
Copy link

ajay987 commented Jul 29, 2017

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

    }
}
        System.out.println();

}
patt13sol

@duwalshraddha
Copy link

Code
package pattern21;

/**
*

  • @author Lenovo
    */
    public class Pattern21 {

    /**

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

@rituratnam
Copy link

CODE:
package pattern9;

/**
*

  • @author Lavalesh
    */
    public class Pattern9 {

    /**

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

    }
    }
    System.out.println();
    }
    }
    }
    Output:
    pattern9

@sarumdr
Copy link

sarumdr commented Jul 29, 2017

package pattern14;

/**
*

  • @author sarumdr
    */
    public class Pattern14 {

    /**

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

/**
*

  • @author nissus
    */
    public class Pat23 {

    /**

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

}
pat23

@sanzeevtamang
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 pattern9;

/**
*

  • @author Eev
    */
    public class PatterN9 {

    /**

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

      int x = 1;
      for (int i = 1; i <= 5; i++) {
      for (int j = 1; j <= i; j++) {
      if ((i + j) % 2 == 0) {
      System.out.print(1);
      } else {
      System.out.print(0);
      }

       }
      
       System.out.println();
      

      }

    }

}
image

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

/**
*

  • @author DELL
    */
    public class Classpro {

    /**

    • @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++) {

           int a = (i + j);
           if (a % 2 == 0) {
               System.out.printf("0");
           } else {
               System.out.printf("1");
      
           }
      
       }
       System.out.println("");
      

      }
      }

}

OUTPUT
101010

@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