Last active
January 19, 2021 22:52
-
-
Save sojohnnysaid/014253a3e0af87048885a32f49141f76 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
#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