Write a c program to find volume of a cone










#include<stdio.h>
#include<math.h>
int main(){
    float radius,height;
    float volume,surfaceArea;
    printf("Enter the radius of base  of cone : ");
    scanf("%f",&radius);
    printf("Enter the height of the cone : ");
    scanf("%f",&height);
    volume =(M_PI * radius * radius)* height ;
    printf("Volume of cone is %f \n", volume);
    surfaceArea = (M_PI * radius * radius) + (M_PI * radius * height);
    printf("Surface area of cone is %f : ",surfaceArea);
    return 0;
}





Alogrithm:
**




No comments: