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
Science,
5 months ago
Math,
5 months ago
English,
5 months ago
English,
9 months ago
Political Science,
1 year ago