Pyramid Problem No. 82
Q.82 Print below nested star pyramid as:
* *** *** * ** ** ** ** *** * * ***
Solving in C:#include <stdio.h> int main(){ int row,col; for(row=1; row<=3; row++){ for(col=1;col<=11; col++){ if(col==11/2+1 || col==row+1 || col==11-row) printf(" "); else printf("*"); } printf("\n"); } return 0; }
Comments
Post a Comment