Sunday, August 19, 2018

How to print Number Pyramid Pattern in java?



package com.npp.test;

public class Test {

public static void main(String[] args) {

int n=9;
for(int i=n;i>=1;i--){
for(int j=n;j>=1;j--){
System.out.print(j>i?" ":i+" ");
}
System.out.println();
}
}
}





How to print Number Pyramid Pattern in java?
How to print Number Pyramid Pattern in java?

Share this

0 Comment to "How to print Number Pyramid Pattern in java?"

Post a Comment