Guest User

Untitled

a guest
Sep 22nd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char prnt = '*';
  5. int i,j,k,s,nos = 4;
  6. for(i=1;i<=5;i++)
  7. {
  8. for(s=nos;s>=1;s--)
  9. {
  10. prntf(" ");
  11. }
  12. for(j=1;j<=i;j++)
  13. {
  14. printf("%c",prnt);
  15. }
  16. for (k=1;k<=(i-1);k++)
  17. {
  18. if(i==1)
  19. {
  20. continue;
  21. }
  22. printf("%c",prnt);
  23. }
  24. printf("\n"); nos--;
  25. }
  26. nos=1;
  27. for(i=4;i>=1;i--)
  28. {
  29. for(s=nos;s>=1;s--)
  30. {
  31. printf(" ");
  32. }
  33. for(j=1;j<=i;j++)
  34. {
  35. printf("%c",prnt);
  36. }
  37. nos++;
  38. printf("\n");
  39. }
  40. nos=3;
  41. for(i=2;i<=5;i++)
  42. {
  43. if((i%2)!=0)
  44. {
  45. for(s=nos;s>=1;s--);
  46. {
  47. printf(" ");
  48. }
  49. for(j=1;j<=i;j++)
  50. {
  51. printf("%c",prnt);
  52. }
  53. }
  54. if((i%2)!=0)
  55. {
  56. printf("\n");
  57. nos--;
  58. }
  59. }
  60. }
Add Comment
Please, Sign In to add comment