Advertisement
Naimul_X

Untitled

Mar 3rd, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int a,i,sp,n;
  5. printf("ENTER THE NUMBER:");
  6. scanf("%d",&n);
  7. for(a=1;a<=n;a++)
  8. {
  9. for(sp=1;sp<=n-a;sp++)
  10. {
  11. printf(" ");
  12. }
  13.  
  14. for(i=1;i<=(2*a)-1;i++)
  15. {
  16. printf("*");
  17. }
  18. printf("\n");
  19.  
  20.  
  21. }
  22.  
  23. for(a=n-1;a>=1;a--)
  24. {
  25. for(sp=1;sp<=n-a;sp++)
  26. {
  27. printf(" ");
  28. }
  29.  
  30. for(i=1;i<=(2*a)-1;i++)
  31. {
  32. printf("*");
  33. }
  34.  
  35. printf("\n");
  36.  
  37.  
  38. }
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement