Tux Education Our New Education Channel Please Share And Subscribe It...

/* C Program To Find Out Surface Area & Volume Of A Cone */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>
#include<math.h>

int main()
{
    float r,h;
    float surface_area,volume;

    printf("Radius : ");
    scanf("%f",&r);
    printf("\n\nHeight : ");
    scanf("%f",&h);

    surface_area = M_PI * r * (r + sqrt(r*r + h*h));
    volume = (1.0/3) * M_PI * r * r * h;

    printf("\n\n\nSurface Area Of Cone Is: %.3f",surface_area);
    printf("\n\n\nVolume Of Cone Is : %.3f",volume);
    
    getch();
    return 0;
}

Post a Comment