sahadat49

Star Pyramid

Aug 4th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. package starpyramid;
  2. import java.util.Scanner;
  3. public class StarPyramid {
  4.  
  5. public static void main(String[] args) {
  6. int row,i,j;
  7. Scanner sc = new Scanner (System.in);
  8. System.out.println("Enter number of rows:");
  9. row = sc.nextInt();
  10. for(i=1; i<=row; i++){
  11. for(j=1; j<=i; j++){
  12. System.out.print("*");
  13. }
  14. System.out.print("\n");
  15. }
  16. }
  17.  
  18. }
Add Comment
Please, Sign In to add comment