*
**
***
**
***
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
for(int i=1; i<=3; i++){
for(int j=1; j<=i;j++){
System.out.print("*");
}
System.out.println();
}
}
}
==============
*
**
***
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number of rows: ");
int row = scan.nextInt();
for (int i = 1; i <= row; i++){
for (int j = row; j >= i; j--){
System.out.print(" ");
}
for (int j = 1; j <= i; j++){
System.out.print("* ");
}
System.out.println();
}
}
}
একটি মন্তব্য পোস্ট করুন