Write a program to print the following pattern in java:
1
23
345
4567
56789
//Thank you
Answers
Answered by
15
hope it helps!!
#sumedhian ❤❤
Attachments:
Answered by
0
Answer:
class pt3
{
void accept()
{
int k=1;
for(int i=1; i<=5; i++){
for(int j=1; j<i; j++){
System.out.print(k);
k++;
}
System.out.println();
}
}
public static void main(String args[])
{
pt3 ob =new pt3();
ob.accept();
}
}
Output:
Attachments:
Similar questions
Sociology,
5 months ago
Social Sciences,
5 months ago
English,
11 months ago
Political Science,
1 year ago