Computer Science, asked by nyesha1821, 10 months ago

Write a Java program to print a pattern as :
*****
****
***
**
*​

Answers

Answered by Janhvi750
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 Brenquoler
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