Computer Science, asked by pamayyajeeva7503, 7 months ago

Write a program to display the given pattern. B
BL
BLU
BLUE
BLUEJ

Answers

Answered by sswaraj1407
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 atrs7391
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