please wap to print this pattern in java
Attachments:
Answers
Answered by
1
hope it helps!
#sumedhian ❤❤
Attachments:
Answered by
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