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]
4 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]4 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
What are two tasks that need to be done to a hard drive before operations can use it
Montano1993 [528]
First insert the harddrive then go to computer (the program) and click on hard drive.  :)
3 0
3 years ago
Jjgdg gegg tget t446v
lesya692 [45]
Hmmm yes, this seems reasonable
7 0
3 years ago
Read 2 more answers
7. In order to check your following distance, use a fixed object and count seconds.
rewona [7]

Answer:

False

Explanation:

7 0
3 years ago
Read 2 more answers
What mechanism can organizations use to prevent accidental changes by authorized users?.
AlladinOne [14]

The process of monitoring and managing changes to software code is known as version control, commonly referred to as source control.  Version control ensures that two users cannot update the same object.

<h3>What is meant by Version control?</h3>

A series of software engineering tools called version control regulates how changes are made to texts, sizable websites, computer programmes, and other collections of information. Version control is a component of software configuration management.

Version control, often known as source control, is the process of keeping track of and controlling changes to software code. Version control systems are computer programmes that help software development teams keep track of changes to source code over time.

Version control improves teamwork and communication while assisting software development teams in keeping track of code changes. Version control enables straightforward, ongoing programme development.

To learn more about version control refer to:

brainly.com/question/26533170

#SPJ4

4 0
2 years ago
Google is an example of a(n): Web site.search engine.search directory. subject directory
lora16 [44]
Google is famously known as a search engine and it is being used around the globe. Aside from being a search engine, it also offers other services such as productivity software or google docs, e-mail services like Gmail, cloud storage or the google drive and it also offers social networking services through google plus. Google also has some desktop application for free of use such as google chrome, picasa and instant messaging like hangouts. Their mission statement as for being the most used search engine is "to organize the world's information and make it universally accessible and useful".
6 0
4 years ago
Other questions:
  • With a two-dimensional array, the ____ field holds the number of rows in the array.
    6·1 answer
  • Adjusting the ______ adjusts the difference in appearance between light and dark areas of the photo.​
    10·2 answers
  • How much memory will be occupied by black and white image​
    8·2 answers
  • Step into my world
    7·2 answers
  • To cope with the uncertainty about how their pages will be viewed, many web page designers opt to use _________ units, which are
    13·1 answer
  • Specialization of computer engineering ?<br>​
    7·1 answer
  • Weegee confused. <br><br> Why is weegee.org kitty website...?
    8·2 answers
  • What is web browser <br>​
    7·2 answers
  • You are configuring NIC Teaming on a Windows Server system using two physical network adapters. You want to aggregate the bandwi
    10·1 answer
  • us refe rence: so 1 ac 2 2. describe the applications for merged documents in terms of the following benefits 2. describe the ap
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!