write a code to inverse the pyramid .
Vaishnavi Shrivastava
1 min read
import java.util.Scanner;
/**
* Link4
*/
public class Link {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("enter a number");
int n = sc.nextInt();
// System.out.println("enter a number");
// int m = sc.nextInt();
for (int i = n; i >= 1; i--) { //for outer loops , rows
for (int j = 1; j <=i; j++) {
System.out.print("*");// for inner loops , columns
}
System.out.println();
}
}
}
0
Subscribe to my newsletter
Read articles from Vaishnavi Shrivastava directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by