Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
recursive fundamentos
//gcc 5.4.0 #include <stdio.h> int factorial(int n, int acc){ if ( n == 1){ return acc; } else{ return factorial(n-1,acc*n); } } int potencia( int n, int num,int acc){ if( n ==1){ return acc; } else{ return potencia(n-1,num,acc*num); } } int main(void){ int res = factorial ( 4,1); printf("%d\n", res); printf("%d",potencia(3,2,1)); }
run
|
edit
|
history
|
help
0
prime or not
Poiter minus
18BCE2182 LAB FAT-2(A)-(i)
Welcome1
C_141127_MatrizProducto
pointer**
Atoi test
fork() System call
cstructCricket
summing long int