write a program in java to print the following pattern
B
BL
BLU
BLUE
BLUEJ
Answers
Answered by
6
Answer:
public class pattern
{
public static void main (String args[ ])
{
String s ="BLUEJ";
int a, l;
l=s.length();
int(a=1;a<=l;a++)
{
System.out.println(s.substring(0,a));
}
}
}
Answered by
0
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