Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/cono.c Secret

Created August 24, 2021 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/07f89c9cd5824e7dae4d1839907f1b9e to your computer and use it in GitHub Desktop.
Save parzibyte/07f89c9cd5824e7dae4d1839907f1b9e to your computer and use it in GitHub Desktop.
/*
https://parzibyte.me/blog
*/
#include <stdio.h>
#include <math.h>
double calcularVolumen(double radio, double altura)
{
return (M_PI * pow(radio, 2) * altura) / 3;
}
int main()
{
double radio, altura;
printf("Ingresa el radio: ");
scanf("%lf", &radio);
printf("Ingresa la altura: ");
scanf("%lf", &altura);
double volumen = calcularVolumen(radio, altura);
printf("El volumen del cono es %lf", volumen);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment