WRITE A JAVA PROGRAM TO BELOW PATTERN :
A B C D E
A B C D
A B C
A B
A
Answers
Answered by
3
import java.util.*;
class ap1
{
public static void main(String args[])
{
int i,j,n;
Scanner sc = new Scanner(System.in);
System.out.println("Enter the no of lines");
n=sc.nextInt();
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
System.out.print((char)(i+64));
}
System.out.println("");
}
}
}
Similar questions