Comment on Tutorial - C++ Recursion function explained using Fibonacci series By Emiley J



Comment Added by : Tahani

Comment Added at : 2011-04-26 11:55:34

Comment on Tutorial : C++ Recursion function explained using Fibonacci series By Emiley J
my answer for this Question is :

#include <iostream>
using namespcae std;

in fib (int n)
{
if (n==0)
return 1;
else
return fib(n-1)+fib(n-2);
}


int main()
{
int x;
cout<<"please enter a number"<<endl;
cin>>x;
cout<<"The fibonacci of "<<x<<"is"<<fib(x);

return 0;
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. hey plz tell me... can the sequenceinputstream be
View Tutorial          By: gaurav at 2010-08-18 17:21:58

2. Hi there! the coding are SUPERB..bt i do nd help i
View Tutorial          By: lily sandra at 2008-01-15 18:30:33

3. HELP ME HOW TO ANALZE THE PROGRAM??????????
View Tutorial          By: MICHELLE FLORES at 2009-01-21 23:24:52

4. This is very simple and easy to understand.

View Tutorial          By: satish at 2011-12-25 09:03:16

5. Hi , it was nice tutorial to understand the differ
View Tutorial          By: jagan at 2014-06-05 05:13:59

6. Sir your example is god
but i am surprisin

View Tutorial          By: Ata Ul Nasar at 2011-06-05 16:23:09

7. how to connect jdbc in java on mysql
View Tutorial          By: naseem at 2011-10-26 19:26:45

8. the example program is very simple to understand a
View Tutorial          By: Zubilu at 2010-10-06 00:19:13

9. Right, so were is the tutorial files.zip?
O

View Tutorial          By: jeremy at 2011-10-24 15:58:40

10. Thanks!! Its very helpful.
View Tutorial          By: Tawfiiq at 2012-07-06 05:29:50