import java.io.Console; class Loop3 { public static void main(String args[]) { int n; String s=""; Console con=System.console(); System.out.print("Enter your Number : "); n=Integer.parseInt(con.readLine()); for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { if(i<=n-j) { System.out.print(" "); } } if(i>=1) { s+="*"; System.out.print(s); } System.out.println(); } } }
Comments
Post a Comment