Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- float factn=1,m,sum;
- cout<<"enter nn";
- cin>>n;
- if(n<10&&n>=0){
- do{
- factn=factn*n;
- m=1/factn;
- sum=sum+m;
- n--;
- }while(n>=1);
- cout<<sum;
- }
- else{
- cout<<"error!n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement