Write a program to print the following pattern -
A
A A
A AA
Answers
Answered by
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