Answer to Question #19077 in C++ for kshitij

Question #19077
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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS