subject

Given sphereRadius and piVal, compute the volume of a sphere and assign to sphereVolume. Look up the equation online (e. g., http://math. about. com/od/formulas/ss/surfaceareavol. htm). Use (4.0 / 3.0) to perform floating-point division, instead of (4 / 3) which performs integer division.

#include

int main(void) {
const double piVal = 3.14159;
double sphereVolume = 0.0;
double sphereRadius = 0.0;

sphereRadius = 1.0;

printf("Sphere volume: %lf\n", sphereVolume);

return 0;

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
The place where the extended axis of the earth would touch the celestial sphere is called the celestial
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
You know the right answer?
Given sphereRadius and piVal, compute the volume of a sphere and assign to sphereVolume. Look up the...
Questions
question
History, 15.06.2020 21:57
question
History, 15.06.2020 21:57
question
Physics, 15.06.2020 21:57
question
Mathematics, 15.06.2020 21:57
question
Biology, 15.06.2020 21:57
question
Mathematics, 15.06.2020 21:57
Questions on the website: 13722359