Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- int change = 2;
- int temp = 5;
- int decider = 1;
- int count = 2;
- int checker = 0;
- int totalLoops;
- int innerBoxBreadth, innerBoxHeight, outerBoxBreadth, outerBoxHeight;
- int innerBoxBreadthLimit = 0;
- int innerBoxHeightLimit = 0;
- int outerBoxHeightLimit = 0;
- int outerBoxBreadthLimit = 0;
- int main(void) {
- printf("Enter Size of outerBox Height:");
- scanf("%d", &outerBoxHeight);
- printf("Enter Size of innerBox Height:");
- scanf("%d", &innerBoxHeight);
- printf("Enter Size of outerBox Breadth:");
- scanf("%d", &outerBoxBreadth);
- printf("Enter Size of innerBox Breadth:");
- scanf("%d", &innerBoxBreadth);
- printf("\n");
- totalLoops = innerBoxBreadth*innerBoxHeight*outerBoxBreadth*outerBoxHeight;
- ronaldo();
- }
- void ronaldo(){
- if(checker >= totalLoops){
- exit(0);
- }
- checker++;
- //------1------
- if(decider == 1){
- innerBoxBreadthLimit++;
- if(change%2 == 0){
- printf("*");
- }
- else printf("#");
- }
- else{
- innerBoxBreadthLimit++;
- if(change%2 == 0){
- printf("#");
- }
- else printf("*");
- }
- //------1------
- //------2------
- if(innerBoxBreadthLimit == innerBoxBreadth){
- if(temp == 5){
- change=3;
- temp = 6;
- }
- else{
- change = 2;
- temp = 5;
- }
- innerBoxBreadthLimit = 0;
- outerBoxBreadthLimit++;
- }
- //------2------
- //------3------
- if(outerBoxBreadthLimit == outerBoxBreadth){
- change = 2;
- temp = 5;
- printf("\n");
- outerBoxBreadthLimit = 0;
- innerBoxHeightLimit++;
- }
- //------3------
- //------4------
- if(innerBoxHeightLimit == innerBoxHeight){
- innerBoxHeightLimit = 0;
- if(count%2 == 0){
- decider = 2;
- }
- else decider = 1;
- count++;
- }
- //------4------
- ronaldo();
- }
Add Comment
Please, Sign In to add comment