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