TO PRINT PATTERN TYPE 19
A
ABA
ABCBA
ABCDCBA
class Pattern19
{
public static void main(String[] args)
{
for(int i=1;i<=4;i++)
{
char x='A';
for(int j=1;j<=7;j++)
{
if(j>=5-i &&j<=3+i)
{
System.out.print(x);
if(j<4)
x++;
else
x--;
}
else
{
System.out.print(" ");
}
}
System.out.println();
}
}
}
Comments
Post a Comment