Dain1234 / Java-Programming

0 stars 0 forks source link

Opposite right pyramid #20

Open Dain1234 opened 1 year ago

Dain1234 commented 1 year ago

package com.dain.logics;

import java.util.Scanner;

public class opposite_right_pyramid { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the rows:"); int r = sc.nextInt(); for (int i = 1; i <= r; i++) { for (int j = 1; j <= r - i; j++) { System.out.print(" "); } for (int k = 1; k <= i; k++) { System.out.print("*"); } System.out.println(); } } }