Advertisement
saira12tabassum19

Untitled

Jul 9th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. //problem no a
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. int row, c, n, s;
  7.  
  8.  
  9. scanf("%d", &n);
  10.  
  11. s = n;
  12.  
  13. for (row = 1; row <= n; row++)
  14. {
  15. for (c = 1; c < s; c++)
  16. printf(" ");
  17.  
  18. s--;
  19.  
  20. for (c = 1; c <= 2*row - 1; c++)
  21. printf("*");
  22.  
  23. printf("\n");
  24. }
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement