Created
May 24, 2016 08:03
-
-
Save jmramirezpro/2e3e7da383b80a332935909b7470659a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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