Computer Science, asked by Enegizer, 3 months ago

how to print 1 2 3 4 5
2 2 3 4 5
3 3 3 4 5
4 4 4 4 5
5 5 5 5 5
In java​

Answers

Answered by aditisinghixem
1

Answer:

1 2 3 4 5

2 3 3 4 5

3 3 3 4 5

4 4 4 4 5

5 5 5 5 5

Explanation:

hope to help.

Answered by hemasamhitha89
1

Answer:

public class Pattern7 {

 public static void main(String[] args) {

   int i,j,n=5;

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

    {

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

   

   if(j>=i)

   {

   System.out.print(j);

   }

   else

   {

    System.out.print(i);

   }

  }

    System.out.println();

    }

}

}

Explanation:

Similar questions