parent
799b2e2588
commit
ccba676af4
@ -0,0 +1,19 @@ |
|||||||
|
#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; |
||||||
|
} |
Loading…
Reference in new issue