Math, asked by sumerchahal2207, 10 months ago

c++ coding for calculate the volume and curved surface are of cylinder

Answers

Answered by Anonymous
5

#include <bits/stdc++.h>

#define PI 3.14159

using namespace std;

// Function To Calculate Volume OF Cylinder

void volume(float r, float h)

{

float vol = PI * r * r * h;

cout << "Volume of Cylinder = " << vol << "\n" ;

}

// Function To Calculate Total Surface Area OF Cylinder

void totalsurfacearea(float r, float h)

{

float tsurf_ar = (2 * PI * r * h) + (2 * PI * r * r);

cout << "Total Surface Area Of Cylinder = " << tsurf_ar << "\n";

}

// Function To Calculate Curved Surface Area OF Cylinder

void curvedsurfacearea(float r, float h)

{

float cursurf_ar = (2 * PI * r * h);

cout << "Curved Surface Area Of Cylinder = "

<< cursurf_ar << "\n";

}

// Driver code

int main()

{

float r = 5;

float h = 8;

volume(r, h);

totalsurfacearea(r, h);

curvedsurfacearea(r, h);

}

\huge\underline\mathfrak\blue{Mark \ as \ brainliest }

Answered by deepsen640
1

Step-by-step explanation:

#include <bits/stdc++.h>

#define PI 3.14159

using namespace std;

// Function To Calculate Volume OF Cylinder

void volume(float r, float h)

{

float vol = PI * r * r * h;

cout << "Volume of Cylinder = " << vol << "\n" ;

}

// Function To Calculate Total Surface Area OF Cylinder

void totalsurfacearea(float r, float h)

{

float tsurf_ar = (2 * PI * r * h) + (2 * PI * r * r);

cout << "Total Surface Area Of Cylinder = " << tsurf_ar << "\n";

}

// Function To Calculate Curved Surface Area OF Cylinder

void curvedsurfacearea(float r, float h)

{

float cursurf_ar = (2 * PI * r * h);

cout << "Curved Surface Area Of Cylinder = "

<< cursurf_ar << "\n";

}

// Driver code

int main()

{

float r = 5;

float h = 8;

volume(r, h);

totalsurfacearea(r, h);

curvedsurfacearea(r, h);

}

Similar questions