Skip to content

Instantly share code, notes, and snippets.

@GReturn
Created February 22, 2024 08:33
Show Gist options
  • Save GReturn/c3de8e2ccf872cbcce3f559094d591e0 to your computer and use it in GitHub Desktop.
Save GReturn/c3de8e2ccf872cbcce3f559094d591e0 to your computer and use it in GitHub Desktop.
mult table - recursion implementation
#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