Computer Science, asked by jashghelani27, 3 months ago

java program to print
To print the following pattern
4
33
222
1 1 1 1​

Answers

Answered by peeyush321kumar
0

n=4;

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

{

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

{

System.out.print(n)

}

n--

}

Answered by anindyaadhikari13
0

Answer:

The java program for the given pattern is as follows -

public class Pattern    {

   public static void main(String args[])  {

       int i,j,n=4;

       for(i=1;i<=4;i++,n--)   {

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

               System.out.print(n+" ");

           System.out.println();

       }

   }

}

Refer to the attachment for output. I have added the cσde in .txt file.

•••♪

Attachments:
Similar questions