Computer Science, asked by abhijeetminz00, 2 months ago

wap Java program pattern
1234
1234
234
234
34
34
4
4​

Answers

Answered by anindyaadhikari13
10

\texttt{\textsf{\large{\underline{Solution}:}}}

The given co‎de is written in Java.

public class Pattern    {

   public static void main(String args[]){

       int i,j,n=4;

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

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

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

           System.out.println();

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

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

           System.out.println();

       }

   }

}

See the attachment for output.

Attachments:
Answered by kamalrajatjoshi94
1

Answer:

Program:-

public class Main

{

public static void main(String args[])

{

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

{

for(int j=i;j<=4;j++)

System.out.print(j+" ");//In order to print it one time

System.out.println();

for(int j=i;j<=4;j++)

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

System.out.println();//In order to print it second time

}

}

}

Attachments:
Similar questions