public class halfinvertertri
{
public static void main (String[] args)
{
String str = "*";
String st = "*";
int row;
int col;
for(row=5;row>0;row--)
{
for(col=1;col<=row;col++)
{
System.out.print(" ");
}
System.out.print(str);
str = str + "*";
System.out.println ("");
}
}
}
OUTPUT WILL BE:
*
**
***
****
*****
try it yourself and try to make an experiment out of this example
No comments:
Post a Comment