Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.