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

Popular posts from this blog

Pyramid Problem No. 90

Pyramid Problem No. 74

Pyramid Problem No. 85