Commit 85dd3a8e authored by kenkeiras's avatar kenkeiras

Added objective C pure recursive fibonacci example

parent c8e5726b
#import <stdio.h>
int fibonacci(int n){
if (n < 2){
return 1;
}
else{
return fibonacci(n - 1) + fibonacci(n - 2);
}
}
int main(){
int numero = 10;
int resultado = fibonacci(numero);
printf("Elemento nº %i de fibonacci: %i\n", numero, resultado);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment