Star Pattern-4
*****
****
***
**
*
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include<stdio.h> #include<conio.h> int main() { int i, j, k,n; printf("Enter no. of rows for which you want to print*: \n"); scanf("%d",&n); for(i=n;i>=1;i--) { for(j=n;j>=i;j--) { printf(" "); } for(k=1;k<=i;k++) { printf("*"); } printf("\n"); } return 0; } |
Comments
Post a Comment