Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *
- ***
- *****
- *******
- where row = 4
- */
- #include<stdio.h>
- int main() {
- int n, m;
- scanf("%d", &n);
- int row = n;
- int collumn = (2 * n) - 1;
- int low = (collumn + 1)/2;
- int high = low;
- for(int i=1;i<=row;i++) {
- for(int j=1;j<=collumn;j++) {
- if(j>=low&&j<=high) {
- printf("*");
- }
- else {
- printf(" ");
- }
- }
- printf("\n");
- low--;
- high++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement