Kizspy.me
62.83
3.14
Question 2:
(3 marks)
The given file Q2.cpp already contains statements to input the integer variable named n (n>=0). You
should write statements to calculate expression value:
1 1
S=1+++....
2 5
1
+
n*n+1
Notes:
-Do not edit given statements in the main function
- You can create new functions if you see it is necessary.
-The output result is formatted in two decimal places
Sample input and output:
Input: n = 2
Zoom
+ 100%
Input: n = 3
Activate Windows
Go to Settings to activate Windows.
Close