Created
February 22, 2024 08:33
-
-
Save GReturn/c3de8e2ccf872cbcce3f559094d591e0 to your computer and use it in GitHub Desktop.
mult table - recursion 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 drawLine(int x, int y) | |
{ | |
if(x==0) return; | |
drawLine(x-1, y); | |
printf("%d\t", x*y); | |
} | |
void f(int num) | |
{ | |
if(num == 0) return; | |
int x = 10; | |
f(num-1); | |
drawLine(x, num); | |
printf("\n"); | |
} | |
int main() | |
{ | |
f(10); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment