Question:Write a c program or code to find or calculate the volume and surface area of cone 

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

int main(){

    float r,h;
    float surface_area,volume;

    printf("Enter size of radius and height of a cone : ");
    scanf("%f%f",&r,&h);

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

    printf("Surface area of cone is: %.3f",surface_area);
    printf("\nVolume of cone is : %.3f",volume);

    return 0;
}
Sample output: Enter size of radius and height of a cone: 3 10 Surface area of cone is: 126.672 Volume of cone is: 94.248 

+ ExplanationNot Moderated
+ Report
Total Preview: 512
Write a c program or code to find or calculate the volume and surface area of cone
Copyright © 2024. Powered by Intellect Software Ltd