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
A variable must have its type declared but it is not required to be initialized prior to first use.
AnnZ [28]

Answer:

a) TRUE.

Explanation:

The statement is true.We can declare a variable but not initialize it there we can initialize it afterwards when we want to use.On declaring the variable type it tells the compiler to reserve the memory according to the size required for the data type.When we initialize the memory is allocated to that variable.

3 0
3 years ago
A stretching<br> force causing<br> things to be<br> pulled in<br> opposite<br> directions
tatuchka [14]

Explanation:

Please helpppp meee! I'm rn in Ukraine, the invasion has begun early this morning! My house was bombed by a russian shell. I'm hurt!!! Give me some advice!! I don't have any medical substances nearby!!

4 0
2 years ago
:3 11 points!
Lady_Fox [76]

Answer:

If it's for school idk but I have a brothers printer and it has worked since 2009

Explanation:

7 0
3 years ago
To create nested lists within each of these topical areas that would contain links to specific pages on the AllStyles website. I
Gwar [14]

Answer:

The answer is add a new list within a list.

Explanation:

Because a nested list is a list within a list. It is the same effect of a bulleted outline in a word processing document you probably used a variety of indentations and bullet point types to denote items that were subpoints of another item in the outline.

7 0
3 years ago
Using ________, GoPro encourages its millions of customers to submit their best content to the GoPro website to earn rewards and
coldgirl [10]

Answer:

UGC- User Generated Content

Explanation:

<em>It is a combination of making and user generated content a virtual shoe-tie for Go Pro. Go Pro has established a content marketing plataform able to grew into an extreme ecommerce success history.  Instead of renting media company's audience, they use the brand-building services of millions of costumers.</em>

<em>The marketing team provide the tools and plataform to enable their costumers to share the videos and images they capture.</em>

5 0
3 years ago
Other questions:
  • Which process refers to starting up a computer?
    15·2 answers
  • A publisher has a text-only leader board on top of a page, and a text-only small square ad slot within the content of that page.
    7·1 answer
  • What's the problem with this code ?
    14·1 answer
  • What is the term for a Web site that allows users to access and interact with software from any Internet-connected computer or d
    11·1 answer
  • If your database is in archivelog mode, how can you force an archive?
    7·1 answer
  • Convert (520)10 into base 16​
    9·2 answers
  • Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose
    15·1 answer
  • Electronic evidence on computer storage media that is not visible to the average user is called​ ________.
    14·1 answer
  • Who is katie and why is she deleting my answers
    7·2 answers
  • In large organizations, database design and management is handled by a database _____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!