// Java program to Print Reverse Pyramid Star Pattern
// Using While loop
// Importing input output classes
import [Link].*;
// Main class
class GFG {
// Main driver method
public static void main(String[] args)
{
// Declaring and initializing variable to
// Size of the pyramid
int number = 7;
int i = number, j;
// Nested while loops
// Outer loop
// Till condition holds true
while (i > 0) {
j = 0;
// Inner loop
// Condition check
while (j++ < number - i) {
// Print whitespaces
[Link](" ");
}
j = 0;
// Inner loop
// Condition check
while (j++ < (i * 2) - 1) {
// Print star
[Link]("*");
}
// By now, we reach end of execution for one row
// so next line
[Link]();
// Decrementing counter because we want to print
// reverse of pyramid
i--;
}
}
}