Computer Science, asked by av1266108, 9 months ago

please wap to print this pattern in java​

Attachments:

Answers

Answered by Anonymous
1

hope it helps!

#sumedhian ❤❤

Attachments:
Answered by MrTSR
0

Program :

import java.util.Scanner;

public class P1 {

   public static void main(String[] args) {

       Scanner ss = new Scanner(System.in);

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

       int row = ss.nextInt();

       System.out.println();

       int k=1;

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

       {

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

           {

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

           }

       System.out.println("   ");    

       }

   }

}

*Refer attachment for Output*

Attachments:
Similar questions