@rahul tiwari..i have that soln...i think u cnt get question....hw do we knw
the number of terms?/

On Sun, Oct 2, 2011 at 2:09 PM, Rahul Tiwari <rahultiwari6...@gmail.com>wrote:

> working code :
>
> #include<stdio.h>
>
>  int fib(int n)
> {
>        if(n==1) return 0;
>        if(n==2) return 1;
>        return fib(n-1)+fib(n-2);
> }
>
> int main()
> {
>        int n,i,sum=0;
>
>        printf("enter no of terms\t ");
>        scanf("%d",&n);
>        printf("fibonacci series = \t ");
>        for(i=1;i<=n;i++)
>        {
>                printf("%d\t",fib(i));
>                sum+=fib(i);
>        }
>
>        printf("\nsum upto %d terms = %d\n",n,sum);
>        return 0;
> }
>
>
>
> rahul
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to