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
You decide to buy some stocks for a certain price and then sell them at anotherprice. Write a program that determines whether or
Otrada [13]

Answer:

no_of_shares = int(input("Enter the number of shares: "))

purchase_price = float(input("Enter the purchase price of the stock: "))

sale_price = float(input("Enter the sale price of the stock: "))

total_stock_price = purchase_price*no_of_shares

total_spend_on_buying = total_stock_price + (0.03*total_stock_price)

total_sale_price = sale_price*no_of_shares

commission_while_selling = total_sale_price*0.03

net_gain_or_loss = total_sale_price - (total_spend_on_buying + commission_while_selling)

if(net_gain_or_loss<0):

print("After the transaction, you lost {} dollars".format(abs(net_gain_or_loss)))

else:

print("After the transaction, you made {} dollars".format(abs(net_gain_or_loss)))

7 0
3 years ago
. Pam is showing her audience, live on the internet, an article that was posted to a reputable website just hours before her spe
Afina-wow [57]

Answer:

webidence

Explanation:

Webidence is a web source or web sources displayed as evidence during a speech, found by using real-time web access or webpage capture software.

This is an online material which serve as a form of evidence to support ones speech or presentation.

It can be gathered or gotten by making use of capture software, real time web access or webpage.

The main idea behind it is to authenticate your presentation.

4 0
3 years ago
Suppose you draw two cards from a standard deck of 52 playing cards. What is the probability that they are both sixes? Keep at l
GaryK [48]

Answer:

0.00452

Explanation:

There are 4 sixes in a deck. So the chance that the first card you draw is a six, is 4/52. Then there are only 3 sixes left and 51 cards. So the chance that the second one is also a six is 3/51.

The combined chance is the multiplication, i.e., 4/52 * 3/51 = 0.00452

7 0
3 years ago
What are the things the child sees on his way the fair why does he log behind​
Papessa [141]

Hope this helps you.. Sorry for the handwriting.

7 0
3 years ago
Please help!!!!
alex41 [277]




Hi pupil here is your answer :::




➡➡➡➡➡➡➡➡➡➡➡➡➡



Your question :》 Which options are available when a user modifies a recurring appointment? check all that apply.


The answer is => A Open this occurenceand the option D Open the series are the option that shows from the dailog box that shows when attempting to modify the appointments .




⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅




Hope this helps .........
8 0
2 years ago
Other questions:
  • Using Python
    14·1 answer
  • The number of credits awarded for the CLEP exam is determined by__<br> Help pls!
    15·1 answer
  • Is recursion ever required to solve a problem? What other approach can you use to solve a problem that is repetitive in nature?
    5·1 answer
  • Search engines enable you to:A. talk to people via the computer.B. locate Web pages related to a specific subject.C. connect to
    14·1 answer
  • Often an extension of a memorandum of understanding (MOU), the blanket purchase agreement (BPA) serves as an agreement that docu
    11·1 answer
  • to _________________________ is a mouse operation in which you move the mouse until the pointer on the desktop is positioned on
    7·1 answer
  • If you need some one to talk to you can talk to me
    13·2 answers
  • Software that enables the organization to centralize data is called A. Data Repository B. Data Base Management System C. Data Wa
    6·1 answer
  • Business use a fax cover sheet is to
    12·1 answer
  • Why isn't image display working on wacom tablet.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!