please solve the following series program in java
Attachments:
Answers
Answered by
1
Answer:
This is the required Java program for the question.
public class Pattern {
public static void main(String[] args) {
int i,j;
for(i=1;i<=7;i++) {
for(j=1;j<=i;j++)
System.out.print(j+" ");
System.out.println();
}
}
}
Explanation:
- Each row has number from 1 to i where i is the row number. And there are 7 columns.
- To solve this pattern, I have created a for loop that iterates 7 times (equal to the number of rows of the pattern). Then, inside the loop, another loop is created that iterates from 1 to i (i = row number). For example, in the first loop, loop displays number 1, in the second loop, loop displays numbers from 1 to 2 and so on.
- After displaying the row, a new line is displayed.
Refer to the attachment.
Attachments:
Answered by
5
Answer:
Answer is attached Mark as brainliest pleaseeeeee follow up
Attachments:
Similar questions