
One hour of coding within the European Project EURO INFORMATICA  March 19, 2017

Graham – algorithm  January 16, 2017

Fibonacci – recursive algorithm  December 13, 2016

Graphs – related components(algorithm)  December 12, 2016

JavaScript Comments  December 9, 2016

CSS Introduction  December 9, 2016

Java – Modifier Types and Basic Operators  December 8, 2016

Polinom – derivate(algorithm in C)  December 8, 2016

Euclid algorithm  December 8, 2016

Queue – algorithm (Sample 1)  December 8, 2016
Fibonacci – recursive algorithm
Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones:
 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 , 89 , 144 , …
Often, especially in modern usage, the sequence is extended by one more initial term:
 0 , 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 , 89 , 144 , …
#include <stdio.h> long fibo(long x) { if (x == 0  x == 1) return 1; else return fibo(x1)+fibo(x2); } void main() { int n; printf("n=");scanf("%d",&n); printf("fibo(%d) = %ld\n",n,fibo(n)); }
104,307 total views, 341 views today