5 like 0 dislike
166 views

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 (12.1k points)
ID: 25996 - Available when: Unlimited - Due to: Unlimited

retagged by | 166 views
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.100.156
©2016-2024

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)
ID: 25955 - Available when: Unlimited - Due to: Unlimited
| 186 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)
ID: 21795 - Available when: Unlimited - Due to: Unlimited
| 106 views
12,783 questions
183,443 answers
172,219 comments
4,824 users