How do I solve this question in Java.
1
22
333
4444
55555
Answers
Answered by
2
class pattern
{
public static void main ( String args [ ])
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j+" ");
}
System.out.println("");
}
}
}
By this way,you solve this program and print it.
For more java doubts follow me and Mark me brainlest.
Answered by
1
Answer:
public class pattern
{
public static void main ( String args [ ])
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(i+" ");
}
System.out.println("");
}
}
}
Explanation:
Hope it helps:-)
Similar questions