C Program to Find Surface Area of Cone

/*
Objective: C program to calculate surface area of cone
Author: Codesansar
*/

#include<stdio.h>
#include<math.h> //for sqrt() function

#define PI 3.141592

int main()
{
    float area, radius, height;

    // Reading radius
    printf("Enter radius of cone: ");
    scanf("%f", &radius);

    // Reading height
    printf("Enter height of cone: ");
    scanf("%f", &height);

    // Calculating surface area of cone
    area = PI * radius * (radius + sqrt(radius*radius + height*height));

    // Displaying area
    printf("Surface area = %f", area);

    return 0;
}

Output

 

Enter radius of cone: 8
Enter height of cone: 12
Surface area = 563.531372

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
About
Products
Subscribe

If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

    Applauz

    As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

    Subscribe

    If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

      Applauz

      As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

      Copyright by BOLD THEMES. All rights reserved.