write a program in java to print the above patterns.............
Answers
Answer:
B
BL
BLU
BLUE
BLUET
Explanation:
mark me as brainliest
BLUEJ
BLUE
BLU
BL
B
*/
public class Q29A
{
public static void main(String args[])
{
System.out.println("\f");
String str="BLUEJ";
int n=str.length();
for(int i=n;i>=0;i--)
{
System.out.println(str.substring(0,i));
}
}
}
/**
J
And E
UUU
L L L L
B B B B B
*/
public class Q29B
{
public static void main(String args[])
{
String str="BLUEJ";
int n=str.length();
int k=0;
for(int i=4;i>=0;i--)
{
for(int j=0;j<=k;j++)
{
System.out.print(str.charAt(i));
}
System.out.println();
k++;
}
}
}
/**
BLUEJ
LUEJ
UEJ
NOT
J
*/
Hope you will do practical for better understanding of this program.
Hope You had liked my answer.
Keep Learning and Keep Growing
Stay Home Stay Safe ❤️❤️