Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Volume of a Cylinder

    	int rad, height;
    	float vol;

        cout <<" Input the radius of a cylinder: ";
    	cin >> rad;

        cout << "Input the height of a cylinder: ";
        cin >> height;

    	vol = (3.14 * rad * rad * height) ; //3.14 is the pie

        cout << " The volume of a sphere is : "<< vol << endl;
        cout << endl;
 
PREVIOUS NEXT
Tagged: #Volume #Cylinder
ADD COMMENT
Topic
Name
3+9 =