Pattern- 7 star Print
Logic-
for(int i=1; i<=5; i++)
{
for(int j=i; j<=5; j++)
{
System.out.print("* ");
}
System.out.println( );
}
Program-
* * * * *
* * * *
* * *
* *
*
class Pattern7
{
public static void main(String[] args)
{
for(int i=1; i<=5; i++)
{
for(int j=i; j<=5; j++)
{
System.out.print("* ");
}
System.out.println( );
}
}
}
For Proper Understanding Watch the Video :-
Thanks;)
All the Best :)
Keep Learning:)
Study:)
No comments:
Post a Comment