ExecuteProgram
Home
Java
Selenium Webdriver
Display Stars in Triangle Format
Tweet
Pin It
public class DisplayStarTraingle
{
public static void main(String[] args)
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(" * ");
}
System.out.println();
}
}
}
Output:
*
* *
* * *
* * * *
* * * * *
No comments:
Post a Comment
Newer Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment