Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/main.c Secret

Created May 3, 2021 15:40
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/8518471806492e76b36b33736e0f30be to your computer and use it in GitHub Desktop.
Save parzibyte/8518471806492e76b36b33736e0f30be to your computer and use it in GitHub Desktop.
#include <stdio.h>
// Definir PI si no existe
// https://parzibyte.me/blog/2018/11/21/constante-pi-en-c/
#include <math.h>
#ifndef MPI
#define MPI 3.14159265358979323846
#endif
int main()
{
// https://parzibyte.me/blog
double diametro = 0;
printf("Ingresa el diámetro:");
scanf("%lf", &diametro);
double circunferencia = diametro * MPI;
double radio = diametro / 2;
printf("La circunferencia es %.2lf y el radio es %.2lf", circunferencia, radio);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment