import java.util.*; public class test { public static void main(String[] args) { Scanner k = new Scanner(System.in); System.out.print("Input row : "); int n = k.nextInt(); for (int i = 1; i <= n; i++) { for (int j = n; j > i; j--) { System.out.print(" "); } for (int j = i; j > 1; j--) { System.out.print("*"); } // for (int j = 1; j <= i; j++) { // my teacher don't want this line. System.out.print("*"); // my teacher don't want this line. } // But teacher want my output like. ----* ---*** --***** -******* ********* // System.out.println(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)