Question 2:
(3 marks)
The given file Q2.c already contains statements to input data for variable n. You should write statements so that calculate S (S formatted in two decimal places) by n, S is defined as follows:
1 1 0!1!11++S(n) = + + (n-1)! n!
Notes:
-0!= 1
- Do not edit given statements in the main function.
- You can create new functions if you see it is necessary.
- The output value is formatted in two decimal places
Sample input and output:
-Input: n = 2
After processing: result = 2.50
Output for marking:
OUTPUT:2.50
Question 3:
Zoom
+ 100%
Close