subject

The factorial of a nonnegative integer n is written n ! (pronounced "n factorial") and is defined as follows: n ! = n · (n - 1) · (n - 2) · … · 1 (for values of n greater than or equal to 1) and n ! = 1 (for n = 0). For example, 5! = 5 · 4 · 3 · 2 · 1, which is 120. a) Write a program that reads a nonnegative integer and computes and prints its factorial.
b) Write a program that estimates the value of the mathematical constant e by using the formula:
e = 1 + 1/1! +1/2! + 1/3! +
c) Write a program that computes the value of by using the formula
e^x = 1 + x/1! + x^2/2! + x^3/3! +

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:40
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year.txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
When creating a field in a table, you must set the to determine what type of data the field can store. field property data type field type data property
Answers: 1
question
Computers and Technology, 25.06.2019 10:40
If you're using the paintbrush tool and want to change the color of the paint being used what should you change
Answers: 2
You know the right answer?
The factorial of a nonnegative integer n is written n ! (pronounced "n factorial") and is defined as...
Questions
question
History, 04.03.2022 07:40
question
Biology, 04.03.2022 07:40
Questions on the website: 13722361