Computer Science, asked by Gurpreet3373, 1 year ago

B L U E J L U E J U E J E J J Write a program to accept a word (say, BLUEJ) and display the pattern

Answers

Answered by Vintage
2
import java.util.Scanner;
public class Program
{
public static void main(String[] args)
{
Scanner sc= new Scanner(System.in);
String s;
System.out.print("Enter the String:- ");
s=sc.nextLine();
int i,j;
for(i=0;i<s.length();i++)
{
for(j=i;j<s.length();j++)
System.out.print(s.charAt(j)+" ");
System.out.println();
}
}
}
Similar questions