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



Related Tutorials

Java program to get location meta data from an image

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

Archived Comments

1. Thanks for the above code. I am not sure whether t
View Tutorial          By: Koolkabin at 2010-08-20 01:11:27

2. javax.comm.NoSuchPortException
at javax.com

View Tutorial          By: Augustin at 2013-04-27 11:12:47

3. this site and document good for the starter. Thank
View Tutorial          By: davit off at 2011-04-17 06:57:02

4. Hi, my name is Jaime,
I wan't to do a jsp w

View Tutorial          By: Jaime at 2011-10-24 12:47:50

5. it is good to unstand and easy to remember forever
View Tutorial          By: Abdul at 2011-11-10 21:03:41

6. Imports System.Web
Imports System.Net.Mail<

View Tutorial          By: Naresh at 2011-05-24 07:27:12

7. gr8t man.....! i am satisfied with ur explanation
View Tutorial          By: raja deepa at 2011-07-05 13:44:21

8. Just what I needed. Thank you.
View Tutorial          By: Clive Jefferies at 2009-06-01 08:05:15

9. Hello, Can you please send me the complete code to
View Tutorial          By: koksingh at 2008-01-15 00:22:40

10. Error loading win32com: java.lang.UnsatisfiedLinkE
View Tutorial          By: Dinesh557 at 2008-09-23 04:18:47