Pages

Friday 3 May 2013


Here is a program in C++ as how to print the nth number of a Fibonacci series by recursive method


#include"stdio.h"
#include"conio.h"
void main()
{
int num;
long fibo(int);
void printFiboSeries(int);
clrscr();
printf("\nEnter number : ");
scanf("%d",&num);
printFiboSeries(num);
getch();
}
long fibo(int n)
{
if(n<=2)
return 1;
return fibo(n-1) + fibo(n-2);
}

void printFiboSeries(int n)
{
if(n<1 br="">return;
printFiboSeries(n-1);
printf("%d ",fibo(n)); // printf is called when all function call of printFiboSeries is popped up from 
                                   // the stack
}

Suppose input variable is 5 then the result should be 5

                                                            fibo(5)          
                               fibo(4)                      +                    f ibo(3)
           fibo(3)             +         f ibo(2)      +        fibo(2)        +     fibo(1)
fibo(2)   +   fibo(1)     +              1           +             1            +        1
   1         +       1          +              1           +             1            +        1         =  5



Thursday 2 May 2013

Richard Stallman: We're heading for a total disaster

Hands-on with Google Glass - Must watch this

Microsoft IllumiRoom project turns room into video game

Microsoft IllumiRoom project turns room into video game

Microsoft in 2019 [HQ]

Life in 2050

Shocking Facts You Did Not Know A Minute Ago

Manufacturing Future Vision

Productivity Future Vision (2011)


Tiger Tiger burning bright


Hippo Romance


LittleTutor


How To Create Wireless Ad Hoc & share Internet Connection In Windows 8


Howto Integrate BI and ERP and Why You Should Do It


Oracle Business Intelligence : Gestión, análisis y reporting financiero


Oracle Business Intelligence (BI) 11g Demo (High-Definition)