Created
February 18, 2024 09:27
-
-
Save GReturn/c5bde0e2376ca694a477bd2c062b293f to your computer and use it in GitHub Desktop.
Square - Recursive Implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void pr(int wid) | |
{ | |
if(wid == 0) | |
{ | |
printf("\n"); | |
return; | |
} | |
printf("* "); | |
return pr(wid-1); | |
} | |
void ph(int n, int m) | |
{ | |
if(n==0) return; | |
pr(m); | |
return ph(n-1, m); | |
} | |
int main(int argc, char const *argv[]) | |
{ | |
int base = 5; | |
int height = 5; | |
ph(base, height); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment