TO PRINT PATTERN TYPE 26
A
BA
CBA
DCBA
BA
CBA
DCBA
class Pattern26
{
public static void main(String[] args)
{
for(int i=1;i<=4;i++)
{ char x=(char)(64+i);
for(int j=1;j<=4;j++)
{
if(j<=i)
{
System.out.print(x--);
}
else
{
System.out.print(" ");
}
}
System.out.println();
}
}
}
Comments
Post a Comment