Giter VIP home page Giter VIP logo

Comments (19)

milan604 avatar milan604 commented on July 30, 2024

package pattern10;

/**
*

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

    /**

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

       for (int j = 4; j > i; j--) {
           System.out.printf(" ");
         
       }
         for (int k = 0; k < i; k++) {
             
               System.out.printf("%d",a);
               a++;
           }
          int c=b;
         for (int k = 1; k < i; k++) {
               
               System.out.printf("%d",c);
               c--;
           }
        b++;
       System.out.println("");
      

      }
      }

}
screenshot from 2017-07-27 14-37-22

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 javaapplication47;

/**
*

  • @author Kishorr
    */
    public class JavaApplication47 {

    /**

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

}
capture9

from java.

jagdish4249 avatar jagdish4249 commented on July 30, 2024

package pattern6;

/**
*

  • @author jagdish
    */
    public class Pattern6 {

    /**

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

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

      }

    }

}

image

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 patttern_10;

/**
*

  • @author Anish
    */
    public class Patttern_10 {

    /**

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

}
p_10

from java.

kiir33 avatar kiir33 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 pattern5;

/**
*

  • @author KIRANN
    */
    public class Pattern5 {

    /**

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

Output:
capture

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 q10;

/**
*

  • @author DELL
    */
    public class Q10 {

    /**

    • @param args the command line arguments
      */
      public static void main(String[] args) {
      int a = 4;

      for (int i = 0; i < 4; i++) {

       for (int k = 0; k < a; k++) {
           System.out.printf(" ");
       }
       int b = 1;
       for (int j = 0; j < i; j++) {
      
           System.out.print(b);
           b = b + 1;
       }
       for (int k = i + 1; k >= 1; k--) {
           System.out.print(k);
      
       }
      
       System.out.print("\n");
       a = a - 1;
       b = b + 1;
      

      }
      }

}

OUTPUT
10

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

/**
*

  • @author NiiRosh
    */
    public class Pattern10 {

    /**

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

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

      }
      }

}
Output:
pattern10

from java.

Roshanshrestha7 avatar Roshanshrestha7 commented on July 30, 2024

public class Ass101 {

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

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

        for (int k = (i - 1); k >= 1; k--) {
            System.out.print(k);
        }

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

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

/**
*

  • @author admin
    */
    public class Pattern10 {

    /**

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

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

      }

    }

}
capture1

from java.

rabina12 avatar rabina12 commented on July 30, 2024

package pp20;

/**
*

  • @author Albina Praz
    */
    public class Pp20 {

    /**

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

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

      }
      }

}
121

from java.

ajay987 avatar ajay987 commented on July 30, 2024

for (int i = 1; i <= 4; i++) {
for (int j = 3; j >= i; j--) {
System.out.print(" ");
}
for (int l = 1; l < i; l++) {

            System.out.print(l);
        }
        for (int k = i; k >= 1; k--) {
            System.out.print(k);

        }
        System.out.println();
    }

patt10sol

from java.

duwalshraddha avatar duwalshraddha commented on July 30, 2024

Code
public class Pat10 {

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

}
10

from java.

rituratnam avatar rituratnam commented on July 30, 2024

CODE:
package pattern123;

/**
*

  • @author Lavalesh
    */
    public class Pattern123 {

    /**

    • @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 >= 1; k--) {
      System.out.print(k);

}
for (int j = 2; j <= i; j++) {
System.out.print(j);
}
System.out.println();
}
}
}
Output:
pattern10s

from java.

bsnarnzt1 avatar bsnarnzt1 commented on July 30, 2024

package patterntwenty4;

/**
*

  • @author User
    */
    public class PatternTwenty4 {

    /**

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

from java.

Rajjushrestha avatar Rajjushrestha commented on July 30, 2024

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 j = 1; j <= i; j++) {
            System.out.print(j);
        }

        for (int k = (i - 1); k >= 1; k--) {
            System.out.print(k);
        }

        System.out.println();
    }
}

from java.

sarumdr avatar sarumdr 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 pattern16;

/**
*

  • @author sarumdr
    */
    public class Pattern16 {

    /**

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

/**
*

  • @author nissus
    */
    public class Pat10 {

    /**

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

       if(j<=i)
       {
           k=k+1;
       }
       else
       {       k=k-1;
      

      }
      System.out.print(k);
      }

       System.out.println("");
       odd=odd+2;
      

      }
      // TODO code application logic here
      }

}
pat10

from java.

sanzeevtamang avatar sanzeevtamang commented on July 30, 2024

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

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.