Giter VIP home page Giter VIP logo

Comments (25)

milan604 avatar milan604 commented on July 30, 2024

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

from java.

raBbn avatar raBbn commented on July 30, 2024

/*

  • 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

from java.

jagdish4249 avatar jagdish4249 commented on July 30, 2024

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

from java.

pujanchangubhari73 avatar pujanchangubhari73 commented on July 30, 2024

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

from java.

maheshyakami avatar maheshyakami commented on July 30, 2024

/*

  • 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

from java.

sthaanu avatar sthaanu commented on July 30, 2024

/*

  • 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

from java.

karmi214 avatar karmi214 commented on July 30, 2024

/*

  • 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

from java.

sajanbasnet75 avatar sajanbasnet75 commented on July 30, 2024

/*

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

from java.

kiir33 avatar kiir33 commented on July 30, 2024

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

from java.

syslin avatar syslin commented on July 30, 2024

/*

  • 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

from java.

bsnarnzt1 avatar bsnarnzt1 commented on July 30, 2024

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

from java.

kajalmaharjan avatar kajalmaharjan commented on July 30, 2024

//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

from java.

rabina12 avatar rabina12 commented on July 30, 2024
  • @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

from java.

rivab avatar rivab commented on July 30, 2024

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

from java.

Roshantwanabasu avatar Roshantwanabasu commented on July 30, 2024

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

from java.

Rajjushrestha avatar Rajjushrestha commented on July 30, 2024

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

from java.

Roshanshrestha7 avatar Roshanshrestha7 commented on July 30, 2024

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

from java.

Sudan15423 avatar Sudan15423 commented on July 30, 2024

/*

  • 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

from java.

ajay987 avatar ajay987 commented on July 30, 2024

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

from java.

duwalshraddha avatar duwalshraddha commented on July 30, 2024

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

from java.

rituratnam avatar rituratnam commented on July 30, 2024

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

from java.

sarumdr avatar sarumdr commented on July 30, 2024

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

from java.

SusanCB avatar SusanCB commented on July 30, 2024

/*

  • 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

from java.

sanzeevtamang avatar sanzeevtamang commented on July 30, 2024

/*

  • 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

from java.

RakenShahi avatar RakenShahi commented on July 30, 2024

/*

  • 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

from java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.