Created
February 12, 2016 07:54
-
-
Save jmramirezpro/a1d3fb374c29c473e6c1 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
/* | |
* LongitudCircunferencia.c | |
* Ejercicios del Podcast Codigo Fuente - Programa 021 | |
* Escribe un programa que defina la constante PI como 3.1416, | |
* que calcule la longitud de una circunferencia cuyo radio se pide | |
* por entrada estándar al usuario y que la muestre por salida estándar. | |
* Creado el 9 de feb. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
#include <math.h> | |
#define PI 3.14159 | |
int main(void) | |
{ | |
float radio; | |
float longitud; | |
printf ("Introduce el radio de la circunferencia: "); | |
scanf ("%f", &radio); | |
longitud = 2 * PI * radio; | |
printf ("La longitud de una circunferencia de radio %f es: %f\n", | |
radio, longitud); | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment