Print Diamond Number Pattern Program Type 5

2 comments on “Print Diamond Number Pattern Program Type 5”


  • harsh

    import java.util.*;
    public class Main
    {
    public static void main(String[] args) {

    int i,j,n;
    Scanner in = new Scanner(System.in);
    System.out.println(“Enter the rows: “);
    n= in.nextInt();
    int num=2;
    for(i=1;i<=n;i++)
    {
    for(j=1;j=1;i–)
    {
    for(j=1;j<=i;j++)
    {
    System.out.print(temp);
    temp++;
    }

    System.out.println();
    num=num-(i-1);
    temp=num;
    }
    }
    }


    • harsh

      import java.util.*;
      public class Main
      {
      public static void main(String[] args) {

      int i,j,n;
      Scanner in = new Scanner(System.in);
      System.out.println(“Enter the rows: “);
      n= in.nextInt();
      int num=2;
      for(i=1;i<=n;i++)
      {
      for(j=1;j=1;i–)
      {
      for(j=1;j<=i;j++)
      {
      System.out.print(temp);
      temp++;
      }

      System.out.println();
      num=num-(i-1);
      temp=num;
      }
      }
      }