Computer Science, asked by arbaazhussain0611, 4 months ago

Write a program for this pattern.

BLUEJ
BLUE
BLU
BL
B

Attachments:

Answers

Answered by khushbumahak
2

Answer:

Which word we have to use???

Happy

Happ

Hap

Ha

H

I am using happy word because do not know the word to use.

Hope it will help you.

Answered by atrs7391
1

class test

{

   public static void main (String[] args)

   {

       String s ="BLUEJ";

       int l=s.length();

       int a;

       for (a=l; a>=1; a--)

       {

           System.out.println(s.substring(0,a));

       }

   }

}

Similar questions