Write a Java program to print a pattern as :
*****
****
***
**
*
Answers
Answered by
15
public class Brainly
{
public static void main (String args[ ])
{
for(int i = 5 ; i>=1 ; i--)
{
for(int j = 1 ; j<=i ; j++)
{
System.out.print("*");
}
System.out.println( );
}
}
}
Attachments:
Answered by
6
Given pattern:
* * * * *
* * * *
* * *
* *
*
Program in Java to print the given pattern:
class Pattern
{
public static void main (string args [])
{
for( int i=5; i>=5; i--)
{
for (int j=1; j<=i;j++)
{
System.out.print ("*");
}
System.out.println ();
}
}
}
Similar questions