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 to 1)
and
n! = 1 (for n = 0 or n = 1).
For example, 5! = 5 · 4 · 3 · 2 · 1, which is 120. Use while
structures in each of the following:
a) Write a program that reads a nonnegative integer and
computes and prints its factorial. Use the
following function prototype to calculate factorial:
int myFactorial(int n);
b) Write a program that estimates the value of the
mathematical constant e by using the formula:
Use the following function prototype to calculate e:
double myE( );
Hint: Use an accuracy of 10 terms.
c) Write a program that computes the value of ex by using
the formula
Use the following function prototype to calculate e:
double myEx(int x);

Answer Posted / wew

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 to 1)
and
n! = 1 (for n = 0 or n = 1).
For example, 5! = 5 · 4 · 3 · 2 · 1, which is 120. Use while
structures in each of the following:
a) Write a program that reads a nonnegative integer and
computes and prints its factorial. Use the
following function prototype to calculate factorial:
int myFactorial(int n);
b) Write a program that estimates the value of the
mathematical constant e by using the formula:
Use the following function prototype to calculate e:
double myE( );
Hint: Use an accuracy of 10 terms.
c) Write a program that computes the value of ex by using
the formula
Use the following function prototype to calculate e:
double myEx(int x);

Is This Answer Correct ?    14 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

5S training documents

2543


what is means of admistrative distance

1589


sir ,,kindly provide me 10 year old solved question papers of gate ,i am from CS. branch...

1611


what is the difference between oracle 8i vs 9i

1764


what is the working of tcp/ip?

1542






What a test plan contains

1544


Are bridges more stable on concrete or on soil - why?

868


How To Servers For Malitnationl Bank?

1421


how much the percentile as a good percentile in elitmus.

6264


How to work Air cooled and water cooled chiller?

1318


THESE POSTS ARE FOR THE DURATION OF FIVE YEARS. AFTER COMPLETION OF FIVE YEARS, THE PERSONNEL POSTED AGAINST THESE POSTS ARE LIKELY TO BE CONTINUED IN NIC. CAN Any body say that what it will be happened after 5 years? does they through us out from NIC? Is it a temporary job of 5 years is the probation period?

1479


what is program data insulation in dbms?

1915


real time examples for basic concepts in oop

1192


what is the difference between physical address and logical address?

1516


what is the difference between oracle 8i and 9i. if someone could help me out.

1539