Computer Science, asked by greatquotes9297, 1 month ago

Write a program to print the following pattern -

A
A A
A AA​

Answers

Answered by harshitajoshi150505
1

import java.io.*;

class pattern

{

void print()throws IOException

 {

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

     System.out.println(“Enter the value for n”);

     int n=Integer.parseInt(br.readLine());

     int i,j;

     for( i=1;i<=n;i++)

      { for( j=1;j<=i;j++)

          System.out.print(“a”);

          System.out.println();

        }

    }

}

If it helps, kindly mark me the brainliest.

:)

Happy day!

Similar questions