Skip to content

Instantly share code, notes, and snippets.

@sojohnnysaid
Last active January 19, 2021 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sojohnnysaid/014253a3e0af87048885a32f49141f76 to your computer and use it in GitHub Desktop.
Save sojohnnysaid/014253a3e0af87048885a32f49141f76 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <cs50.h>
#define PI 3.14 // declaring what is known as a macro or macro definition
int main(void) {
float circumference, radius;
do
{
circumference = get_float("Find the radius of a circle by entering it's circumference: ");
}
while(circumference <= 0);
radius = circumference / (2 * PI);
printf("Radius is equal to %.2f\n",radius);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment