using for loops in java, how do i create this pattern in the output window?
you an only use System.out.print('*') and System.out.println()
*
**
***
****
*****
******
*******
********
*********
**********
Printable View
using for loops in java, how do i create this pattern in the output window?
you an only use System.out.print('*') and System.out.println()
*
**
***
****
*****
******
*******
********
*********
**********
I don't have a compiler available right now, but something like this should work.
I would really suggest you attempt these kind of things before posting here. You haven't shown any code and it is really just simple math to figure it out.
Code:for(int i = 1; i <= 10;i++){
for(int x = 1; x <=i;x++){
System.out.print("*");
}
System.out.println();
}