Computer Science, asked by Sd12365, 9 months ago

please solve this pattern in java...​

Attachments:

Answers

Answered by anujamishra18604
2

Answer:

import java.util.*;

class pascals_triange

{

   public static void main()

   {

       Scanner sc = new Scanner (System.in);

       int n,i,j,l,m,p;

       System.out.print("Enter the number of rows: ");

       n=sc.nextInt();

       for(i=1;i<=n;i++)

       {

           p=i-1;

           for(l=1;l<=n-i;l++)

           {

               System.out.print(" ");

           }

           for(j=1;j<=i;j++)

           {

               System.out.print("*");

           }

           for(m=1;m<=i-1;m++)

           {

               System.out.print("*");

           }

           System.out.println();

       }

   }

}

Answered by amannishad0512p5zxh6
2

Go through the pic and compile your program in bluej or any other platform of java,I have made without using Scanner.

Attachments:
Similar questions