2 like 0 dislike
1.8k 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.而不是4/3

Example input:

10

Example output:

4188.79
[Exercise] Coding (C) - asked in Chapter 2: C Fundamentals by (12.1k points)
ID: 25483 - Available when: Unlimited - Due to: Unlimited

edited by | 1.8k views

50 Answers

0 like 0 dislike
Hidden content!
#include<stdio.h>



int main(void){






** * * * * * * * * a;
* **** ******* ** ** * ***** b;
** **** * * *** * * ** ** * * * *
** * *** * *** **** **** *
* * ** **** * ** * * * * ** *









}
answered by (-301 points)
0 like 0 dislike
Hidden content!
#include *** ** * **



int main()

{
** * * * * ** * * * * volume = 0;


** *** * * ** * * ** * r = 0;


*** * * ** ** * * *** * * * *** * * **


* *** **** ** * *** * = * ** ** **** *


* * * * ** * **** *** * ** ** ** ** * * ** volume);

}
answered by (-285 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>



int main ()



{
* * * * * *** r;
***** ** *** *** ** * v;


* * ***** ****** ** * ** * ** **** ** * * ** * *


******** * ** ******** * *** * * **** *


* * **** * * *** * * * *** ** *** ***
* ** *** ** * * * * ** ** * 0;



}
answered by (-249 points)
0 like 0 dislike
Hidden content!
***** **** * *

#define pi * * *
** ** a *** *



int main()

{
****** * * * * * * **** x =0;
** * * * * *** ** ** * i;
* * * *** *** * * ** ** * *** ** ***


** ** *** **** ** ** * **** = i * i * i *a *pi;
** * * * ** *** *** * ******* * ******



return 0;

}
answered by (1.1k points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()

{
** ** * ***** * **** r;
*** ** * *** ** * *** * * * * ** * * * **** *
*** * ** *** * * *** * * *** * * ** * * **** *
* * * * *** * * 0;



}
answered by (-255 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()

{
* * ** ** * **** ** * ** r;
* * ****** ** *** **** *** ***** * *** ******* *
* ** *** *** ** * **** *** *** *** ** ** * * * ** *
******* **** * ** ** *** 0;



}
answered by (-255 points)
0 like 0 dislike
Hidden content!
#include ** * *

int main(void)

{
* * * * * r, v;
**** * ** *** * ** * * *** * ** ***
* = * * * *
** ** * * *** * * *** ***** v);
**** ****** **** 0;

}
answered by (-196 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>



int main() {
*** * ***** ** **** input,output;
*** ** *** ** *** * * * *** *** * ******* *
* * ** **** * ** * * *** ** * **
******* * ** * * * * ***** ** *** * * * * *

}
answered by (-120 points)
0 like 0 dislike
Hidden content!
** * ***
*** ********* * *


** * PI * * *
** * RATIO * ***



int ****

float * * *



int main()

{
* * ****** **** * * * ***** * ** *** * * * *** * *
* ** **** ** ** ** * * = RATIO * radius * * * * * *** * PI;
* ***** **** **** * * *** * * * * *** * *
* ***** * **** ** ** * 0;

}
answered by (-286 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include ******** ** * *



int main()

{
** * ** * * ** r,v;
** ** * * * ** ** *** * ** * ** ** ***** * *
* ** * * ** ** * ****** ***** * **** *
******* ** * ** * *** * ** ** * **
******** * * ** **** * 0;

}
answered by (-258 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.131.98
©2016-2024

Related questions

4 like 1 dislike
61 answers
[Exercise] Coding (C) - asked Sep 28, 2017 in Chapter 2: C Fundamentals by thopd (12.1k points)
ID: 25484 - Available when: Unlimited - Due to: Unlimited
| 1.9k views
1 like 0 dislike
73 answers
[Exercise] Coding (C) - asked Sep 28, 2017 in Chapter 2: C Fundamentals by admin (9.9k points)
ID: 25482 - Available when: Unlimited - Due to: Unlimited
| 2.3k views
12,783 questions
183,443 answers
172,219 comments
4,824 users