Here is the program~
/*Pattern.Java.*/
import java.util.*;
public class Pattern_Prog
{
public static void main (String args[ ])
{
Scanner input = new Scanner(System.in);
int length;
System.out.print("Enter a word : ");
String word = input.next( );
length = word. length( );
for(int i = 0; i<= length; i++)
{
for(int j = 0; j<i; j++)
{
System.out.print(" ");
}
System.out.println(word.substring(0,length-i));
}
input.close( );
}
}
Hope it helps you!!