Answer:
#include<iostream>
using namespace std;
int main(){
float radius;
cout<<"Enter the radius of the sphere: ";
cin>>radius;
float diameter = 2*radius;
float circumference = diameter * 3.14;
float surface_area = 4*3.14*radius*radius;
float volume = (4/3)*3.14*radius*radius*radius;
cout<<"The diameter is: "<<diameter<<endl;
cout<<"The circumference is: "<<circumference<<endl;
cout<<"The surface area is: "<<surface_area<<endl;
cout<<"The volume is: "<<volume<<endl;
}
Explanation:
First include the library iostream for input/output in c++ programming.
then, create the main function and declare the variable radius as floating type.
Use cout to print the message on the screen.
Use cin to store the value in the variable.
After that, write the formula to calculate the values and store the results in the variables.
and finally print the result with message.