
how to get the output like this A BB CCC DDDD

Hi Friend,
Try the following code:
class Pyramid
{
public static void main(String[] args)
{
for(char ch1='A';ch1<='D';ch1++){
for(char ch2='A';ch2<=ch1;ch2++){
System.out.print(ch1);
}
System.out.println();
}
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.