You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LearnCCpp/practice/lc_recursion.c

19 lines
267 B

#include <stdio.h>
unsigned int multiply(unsigned int x, unsigned int y)
{
if (x == 1)
return y;
if (x > 1)
return y + multiply(x - 1, y);
return 0;
}
int main()
{
printf("3 times 100 is %d", multiply(3, 100));
return 0;
}