Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package starpyramid;
- import java.util.Scanner;
- public class StarPyramid {
- public static void main(String[] args) {
- int row,i,j;
- Scanner sc = new Scanner (System.in);
- System.out.println("Enter number of rows:");
- row = sc.nextInt();
- for(i=1; i<=row; i++){
- for(j=1; j<=i; j++){
- System.out.print("*");
- }
- System.out.print("\n");
- }
- }
- }
Add Comment
Please, Sign In to add comment