Write a program to display the given pattern. B
BL
BLU
BLUE
BLUEJ
Answers
Answered by
0
Answer:
Public static void main (String[]args){
System.out.println("B");
System.out.println("BL");
System.out.println("BLU");
System.out.println("BLUE");
System.out.println("BLUEJ");
}
Mark me brainliest if this answer is satisfactory
Answered by
3
class test
{
public static void main (String[] args)
{
String s ="BLUEJ";
int l=s.length();
int a;
for (a=1; a<=l; a++)
{
System.out.println(s.substring(0,a));
}
}
}
Similar questions