C Program to Find the Volume and Surface Area of cylinder - IProgramx

Q. Accept dimensions of a cylinder and print the surface area and volume (Hint: surface area =2πr2 + 2πrh, volume = πr2h)
Q. C Program to Calculate Volume and Total Surface Area of Cylinder
Q. Write a c program to find the volume and surface area of cylinder


Program

#include <stdio.h>
#include <math.h>
int main()
{
    float radius, height;
    float surface_area, volume;
    printf("Enter  value for  radius and height of a cylinder : \n");
    scanf("%f%f", &radius, &height);
    surface_area = 2 * (22 / 7) * radius * (radius + height);
    volume = (22 / 7) * radius * radius * height;
    printf("Surface area of cylinder is: %f", surface_area);
    printf("\n Volume of cylinder is : %f", volume);
}

Output:
Enter  value for  radius and height of a cylinder :
4
6
Surface area of cylinder is: 240.000000
 Volume of cylinder is : 288.000000

Post a Comment

3 Comments

  1. Very useful for me thank you so much for this content

    ReplyDelete
  2. Quadratic Equations Class 10 Maths ka ek bahut hi important chapter hai, jo students ke base ko strong banata hai. Is chapter ko samajhna aage ke chapters jaise polynomials, coordinate geometry aur higher classes ke liye bhi kaafi helpful hota hai. Aksar students koQuadratic Equations Class 10
    mein roots nikalne, formula apply karne aur word problems solve karne mein confusion hoti hai, lekin agar concepts clear ho jaayein to ye chapter kaafi easy lagne lagta hai

    ReplyDelete