Guest User

Untitled

a guest
Feb 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. #include "stdio.h"
  2.  
  3. int change = 2;
  4. int temp = 5;
  5. int decider = 1;
  6. int count = 2;
  7.  
  8. int checker = 0;
  9. int totalLoops;
  10. int innerBoxBreadth, innerBoxHeight, outerBoxBreadth, outerBoxHeight;
  11.  
  12. int innerBoxBreadthLimit = 0;
  13. int innerBoxHeightLimit = 0;
  14. int outerBoxHeightLimit = 0;
  15. int outerBoxBreadthLimit = 0;
  16.  
  17. int main(void) {
  18.  
  19. printf("Enter Size of outerBox Height:");
  20. scanf("%d", &outerBoxHeight);
  21. printf("Enter Size of innerBox Height:");
  22. scanf("%d", &innerBoxHeight);
  23. printf("Enter Size of outerBox Breadth:");
  24. scanf("%d", &outerBoxBreadth);
  25. printf("Enter Size of innerBox Breadth:");
  26. scanf("%d", &innerBoxBreadth);
  27.  
  28.  
  29. printf("\n");
  30.  
  31.  
  32. totalLoops = innerBoxBreadth*innerBoxHeight*outerBoxBreadth*outerBoxHeight;
  33. ronaldo();
  34.  
  35.  
  36. }
  37.  
  38. void ronaldo(){
  39.  
  40.  
  41. if(checker >= totalLoops){
  42. exit(0);
  43. }
  44.  
  45. checker++;
  46.  
  47. //------1------
  48. if(decider == 1){
  49. innerBoxBreadthLimit++;
  50.  
  51. if(change%2 == 0){
  52. printf("*");
  53. }
  54. else printf("#");
  55.  
  56. }
  57. else{
  58. innerBoxBreadthLimit++;
  59. if(change%2 == 0){
  60. printf("#");
  61. }
  62. else printf("*");
  63.  
  64. }
  65. //------1------
  66.  
  67. //------2------
  68. if(innerBoxBreadthLimit == innerBoxBreadth){
  69. if(temp == 5){
  70. change=3;
  71. temp = 6;
  72. }
  73. else{
  74. change = 2;
  75. temp = 5;
  76. }
  77. innerBoxBreadthLimit = 0;
  78. outerBoxBreadthLimit++;
  79.  
  80. }
  81. //------2------
  82.  
  83.  
  84. //------3------
  85. if(outerBoxBreadthLimit == outerBoxBreadth){
  86. change = 2;
  87. temp = 5;
  88. printf("\n");
  89. outerBoxBreadthLimit = 0;
  90. innerBoxHeightLimit++;
  91. }
  92. //------3------
  93.  
  94.  
  95. //------4------
  96. if(innerBoxHeightLimit == innerBoxHeight){
  97. innerBoxHeightLimit = 0;
  98.  
  99. if(count%2 == 0){
  100. decider = 2;
  101. }
  102. else decider = 1;
  103. count++;
  104. }
  105. //------4------
  106.  
  107. ronaldo();
  108.  
  109. }
Add Comment
Please, Sign In to add comment