Pyramid Problem No. 79
Q.79 Print Rectangle star pyramid as:
****** * * * * ******
Solving in C:#include <stdio.h> int main(){ int row,col; for(row=1; row<=4; row++){ for(col=1;col<=6; col++){ if(row==1 || col==1 || row==4 || col==6) printf("*"); else printf(" "); } printf("\n"); } return 0; }
Comments
Post a Comment