C++ Chapters

C++ Program to Find the Volume and Surface Area of cylinder.

Structure of C++ Programs - Overview
#include <iostream>
using namespace std;

int main()
{
    float Radius, Height, Volume, Surface_Area, PI = 3.14;
    
    cout << "Enter Radius of Cylinder : ";
    cin >> Radius;
    
    cout << "\nEnter Height of Cylinder : ";
    cin >> Height;
    
    Volume = PI * Radius * Radius * Height;
    Surface_Area = 2 * PI * Radius * (Radius + Height);
    
    cout << "\n\nVolume of Cylinder is : " << Volume;
    cout << "\nSurface Area of Cylinder is : " << Surface_Area;
    
    return 0;
}

Output :
Enter Radius of Cylinder : 10
Enter Height of Cylinder : 20

Volume of Cylinder is : 6280
Surface Area of Cylinder is : 1884

Description :

Volume of cylinder can be calculated as
Volume = Π x R 2 x H
Π = 3.14 (GREEK CAPITAL LETTER PI)
R = Radius of Sphere
H = Height of Cylinder

Surface Area of sphere can be calculated as :
Area = = 2 x Π x R x (R+ H)


Leave a comment
Recent Comments
No Comments