import java.util.Scanner;
public class pat27 {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
System.out.println("Enter The Row Of Pyramid:");
int n=sc.nextInt();
int i,j,k;
for(i=1;i<=n;i++)//row
{
for(j=1;j<=n-i;j++)//column
{
System.out.print(" ");
}
for(k=1;k<=2*i-1;k++)//column
{
System.out.print((char)(64+k));
}
System.out.println("");
}
}
}
No comments:
Post a Comment