write a program to print the sum of the following series : 1/1!+2/2!+3/3!+........N
1
Expert's answer
2012-11-21T09:38:25-0500
#include <iostream> using namespace std; int main (){ cout<<"ENter n\n"; int n; cin>>n;
long long N = 1; for (int i = 1 ; i <= n ; i++){ & N *= i; } cout<< n << '/' << n <<"! = "<<& 1 / double(N) << " = 1/"<<N<<endl; system("pause"); return 0; }
Comments
Leave a comment