public class pattern
{ public static void main(String[] args)
{
int i,j;
for(i=65; i<=68; i++)
{
System.out.print("\n");
for(j=65; j<=i; j++)
{
System.out.print((char) j);
}
}
}
}
{ public static void main(String[] args)
{
int i,j;
for(i=65; i<=68; i++)
{
System.out.print("\n");
for(j=65; j<=i; j++)
{
System.out.print((char) j);
}
}
}
}
output
A
AB
ABC
ABCD
No comments:
Post a Comment
SAY HELLO!!