1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Arturiano [62]
3 years ago
15

The value of the mathematical constant e can be expressed as an infinite series: e=1+1/1!+1/2!+1/3!+... Write a program that app

roximates e by computing the value of 1+1/1!+1/2!+1/3!+...+1/n! where n is an integer entered by the user.
Computers and Technology
1 answer:
LUCKY_DIMON [66]3 years ago
6 0

Answer:

// here is code in c++ to find the approx value of "e".

#include <bits/stdc++.h>

using namespace std;

// function to find factorial of a number

double fact(int n){

double f =1.0;

// if n=0 then return 1

if(n==0)

return 1;

for(int a=1;a<=n;++a)

       f = f *a;

// return the factorial of number

return f;

}

// driver function

int main()

{

// variable

int n;

double sum=0;

cout<<"enter n:";

// read the value of n

cin>>n;

// Calculate the sum of the series

  for (int x = 0; x <= n; x++)

  {

     sum += 1.0/fact(x);

  }

  // print the approx value of "e"

    cout<<"Approx Value of e is: "<<sum<<endl;

return 0;

}

Explanation:

Read the value of "n" from user. Declare and initialize variable "sum" to store the sum of series.Create a function to Calculate the factorial of a given number. Calculate the sum of all the term of the series 1+1/1!+1/2!.....+1/n!.This will be the approx value of "e".

Output:

enter n:12

Approx Value of e is: 2.71828

You might be interested in
How to deactivate the brainly app?​
galina1969 [7]

Answer:

Don't you just uninstall it?

Explanation:

5 0
2 years ago
Read 2 more answers
DOES ANYONE KNOW HOW TO CHAGE THE IP ON A COMPUTER?
MaRussiya [10]
Try downloading a VPN

8 0
3 years ago
Consider an online shopping portal that allows a customer to browse and purchase different products. The products are arranged u
o-na [289]
Way too much to read bye
7 0
2 years ago
Read 2 more answers
When was microsoft word for windows invented?
Dahasolnce [82]
1981 fue inventado por Bill gates y paul allen
4 0
3 years ago
1 Let Σ= {Ac,BA,bcb,cd,ab,d,i}. Find the length for the given below strings
Zepler [3.9K]

Answer:

What in the world

Explanation:

4 0
2 years ago
Other questions:
  • Which part of the os provides users and applications with an interface to manipulate files?
    8·1 answer
  • Tfuuvj vjiibjoon Ghosh kpj
    13·2 answers
  • A low concentration of market power has positive affects. A low concentration of market share has which of the following effects
    7·1 answer
  • The _____ is a blinking vertical line that indicates where the next typed character will appear. scroll box sheet tab insertion
    7·1 answer
  • The MAA is responsible on a daily basis to protect office computers and patient records and personal information from hackers. R
    12·1 answer
  • Creating a chart using a spreadsheet Chart Wizard involves four steps. Which is the last step?
    6·1 answer
  • You want to establish the validity of a test designed for computer technicians using a predictive criterion-related validation s
    9·1 answer
  • If you have defined a class named SavingsAccount with a public static data member named numberOfAccounts, and created a SavingsA
    7·1 answer
  • Which control segment communicates with the satellites? OA master stations O B. monitoring stations O C. ground antennas D. cont
    7·1 answer
  • What is ‘situational awareness” in game design?please answer in a full sentence!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!