5 like 0 dislike

Write a program that computes the volume of a sphere with a radius, using the formula v=(4.0/3.0)*r*r*r*3.141592 . Remember to keep the fraction 4.0/3.0 but not 4/3
The program should output 2 digits after decimal point.

寫一個計算球形體積程式,用這個公式v=(4.0/3.0)*r*r*r*3.141592。

分數寫法4.0/3.0而不是4/3

Example input:

10

Example output:

4188.79
[Normal] Coding (C) - asked in Introduction to Computer Programming I (C) by (11.3k points)
Available when: Unlimited - Due to: Unlimited

retagged by | 50 views
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.79.11
©2016-2020

Related questions

5 like 0 dislike
3 answers
[Normal] Coding (C) - asked Oct 10, 2017 in Introduction to Computer Programming I (C) by admin (9.9k points)
Available when: Unlimited - Due to: Unlimited
| 55 views
3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Jan 25, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 18 views
6 like 0 dislike
2 answers
[Normal] Coding (C) - asked Oct 16, 2017 in Introduction to Computer Programming I (C) by thopd (11.3k points)
Available when: Unlimited - Due to: Unlimited
| 71 views
10,777 questions
120,946 answers
112,852 comments
3,802 users