Skip to content

Instantly share code, notes, and snippets.

@jmramirezpro
Created May 24, 2016 08:03
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 jmramirezpro/2e3e7da383b80a332935909b7470659a to your computer and use it in GitHub Desktop.
Save jmramirezpro/2e3e7da383b80a332935909b7470659a to your computer and use it in GitHub Desktop.
/*
* FuncionAreaCirculo.c
* Ejercicios del Podcast Codigo Fuente - Programa 33
* Escribir una función que calcule el área de un círculo dado su radio.
* Creado el 24 de may. de 2016
* Author: jmramirez
*/
#include <stdio.h>
#include <math.h>
#define PI 3.14159
float areaCirculo (float radio_formal){ /* Parámetro formal */
return ((radio_formal * radio_formal) * PI);
}
int main(void)
{
float radio_real; /* Parámetro real */
printf ("Introduce el radio del circulo: ");
scanf ("%f", &radio_real);
printf ("El círculo de radio %f tiene un area de: %f\n",
radio_real, areaCirculo(radio_real) );
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment