C++ Program to calculate the volume and surface of the cylinder. | सी ++ प्रोग्राम सिलेंडर की मात्रा और सतह की गणना करने के लिए।

C++ Program to calculate the volume and surface of the cylinder.

Let see the program to calculate the volume and surface of the cylinder.

Example:
  1. Formula:

    Volume of cylinder and surface of cylinder
    Cylinder

/* to calculate the volume of the cylinder. */ #include <iostream> using namespace std; int main() { double radius,height,volume; cout<<"Enter radius of cylinder :"; cin>>radius; cout<<"Enter height of cylinder :"; cin>>height; volume=(22/7)*radius*radius*height; cout<<"Volume of cylinder = "<<volume<<" units."<<endl; return 0; }
Output:
Enter radius of cylinder :5.7 Enter height of cylinder :9.3 Volume of cylinder = 906.471 units.
/* to calculate the surface of the cylinder. */ #include <iostream> using namespace std; int main() { float radius,height,volume; cout<<"Enter radius of cylinder :"; cin>>radius; cout<<"Enter height of cylinder :"; cin>>height; volume=2*(22/7)*radius*height+2*(22/7)*radius*radius; cout<<"surface of cylinder = "<<volume<<" sq. units."<<endl; return 0; }
Output:
Enter radius of cylinder :2.4 Enter height of cylinder :5.7 surface of cylinder = 116.64 sq. units.