+ 1
Slove this problem(triangle)
5 Answers
+ 13
Rishi Anand Sir
I think 1st inner loop is purposely created for making spaces at beginning of each line
only !!!$coding Except$!!! can clear what to solve in this
//looks like advertisement post to me đ
+ 9
Hy !!!$coding Except$!!! âș
Have a look at Sololearn guidelines to use q/a section effectively , it looks like an advertisement post [NOT a question]
https://www.sololearn.com/Discuss/1316935/?ref=app
+ 1
Assuming that you want the pattern like
*
***
*****
*******
*********
***********
*************
***************
//here's the code snippet
int count=0;
for(int i=1;I<=8;i++)
{
for(int j=1;j<=i+count;j++)
{
System.out.prinr("*");
}
++count;
System.out.println();
}
+ 1
Gaurav Agrawal I think your are right but if he could post the pattern then the picture will be more clear
0
I modified this one.. check it out once..
public class Program
{
public static void main(String[] args) {
int n=10;
for(int i=1;i<10;i++)
{
for(int j=1;j<n;j++)
{
System.out.print(" ");
}
n--;
for(int k=1;k<=i;k++)
{
System.out.print("* ");
}
System.out.print("\n");
}
}
}