Star Pattern-1
*
**
***
****
*****
Program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include<stdio.h> #include<conio.h> void main() { int r,c,n; printf("Enter the number of rows for which you want to print *:"); scanf("%d",n); for(r=1;r<=n;r++) { for(c=1;c<=r;c++) { printf("*"); } printf("\n"); } getch(); } |
Comments
Post a Comment