Skip to content

Instantly share code, notes, and snippets.

@jmramirezpro
Created February 12, 2016 07:54
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/a1d3fb374c29c473e6c1 to your computer and use it in GitHub Desktop.
Save jmramirezpro/a1d3fb374c29c473e6c1 to your computer and use it in GitHub Desktop.
/*
* 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