Q1_20251109113106.webp
D

Q1_20251109113106.webp

Question 1 (2 marks)
The given file Q1.cpp contains statements to enter the radius r and height h of the cylinder. You
should write statements to to print the area of the around of the cylinder.
Hint:
Notes:
Saround
2πrh.
π use the M_PI in the cmath library
Do not edit given statements in the main function.
You can create new function(s) if you see it is necessary.
Sample input and output:
Input: r=1, h=1
Input: r=2, h=5
After processing: 62.83
After processing: 6.28
Output for marking:
OUTPUT:
Output for marking:
OUTPUT:
62.83
6.28
Question 2:
(3 marks)
The given file Q2.cpp already contains statements to input the integer variable named n. You
should write statements to calculate expression value:
Notes:
+ 100%
Zoom
1
1
1
S=
+
+...+
1*2 2*3
n* (n+1)
Close
Chưa có bình luận nào.

Thông tin

Category
PRF193
Thêm bởi
dinhtrong93
Ngày thêm
Lượt xem
1,055
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom