What is the simplest method to print star pyramid with minimal code? It shouldn't use more than one looping statement. I've produced pyramids with nested loop but I need more leaner code.
CodePudding user response:
int row = 5;
for(int i = 0;i<row;i ){
stdout.writeln(" "*(row-i) "* "*i);
}