Pyramid Problem No. 56
Q. 56 Write a C program to display the reverse star pyramid as:
********** **** **** *** *** ** ** * *
Solving in C:#include <stdio.h> int main(){ int row,col; for(row=1; row<=5; row++){ for(col=1; col<=5-row+1; col++) printf("*"); for(col=1; col<2*row-1; col++) printf(" "); for(col=1; col<=5-row+1; col++) printf("*"); printf("\n"); } return 0; }
Comments
Post a Comment