Surface Area of Cone || Functions in C || Arguments and Returns a value || C Programming
In this, we are going to see the Functions that have arguments and returns a value, this program we are going to find the Surface Area of Cone in C Programming Language.



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

const float pi = 3.142; // Constant global Variable

float display_output(float r, float h)
{
    float surface_area;
    surface_area = pi * r * (r + sqrt((h * h) + (r * r)));
    return surface_area;
}

float main()
{
    system("cls");
    float r, h;
    printf("Enter the base radius of the cone:-\n");
    scanf("%f", &r);
    printf("Enter the height of the cone:-\n");
    scanf("%f", &h);
    printf("Surface area of cone is:- %f", display_output(r, h));
    return 0;
}

//.......Coded by JAIDEEP JAMBLE

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post