Create a class called Series which will contain
the following members function:
(i) long fact(int f) to find the factorial of f
and return it.
(ii) void sumSeries1(int x,int n) to calculate
and print the sum of the following
series: x+x/2!+x/3!+x/4!+...+x/n!
Answers
Answered by
2
Answer:
//Fibonacci Series using Recursion
#include<bits/stdc++.h>
using namespace std;
int fib(int n)
{
if (n <= 1)
return n;
return fib(n-1) + fib(n-2);
}
int main ()
{
int n = 9;
cout << fib(n);
getchar();
Similar questions