aboutsummaryrefslogtreecommitdiff
path: root/Lab 1
diff options
context:
space:
mode:
authoraustinsworld15 <[email protected]>2021-10-13 14:33:42 -0700
committerGitHub <[email protected]>2021-10-13 14:33:42 -0700
commit358161a319cc7e3d278bd425a3a0f6094e578bc7 (patch)
tree9ce1d9c25055d0da1bf55ae6dcd37f67bb938700 /Lab 1
parentAdd online IDE url (diff)
downloadcst116-lab1-austinsworld15-main.tar.xz
cst116-lab1-austinsworld15-main.zip
Diffstat (limited to 'Lab 1')
-rw-r--r--Lab 163
1 files changed, 63 insertions, 0 deletions
diff --git a/Lab 1 b/Lab 1
new file mode 100644
index 0000000..6b80e0b
--- /dev/null
+++ b/Lab 1
@@ -0,0 +1,63 @@
+2a)
+
+//print "enter the radius of the circle:"
+
+//scan the number inputted and store it as <circle_radius>
+
+//run the equation to find the circumference = <2 * 3.1416 * circle_radius>
+
+//print the circumference that was equated, that is the answer
+
+
+
+2b)
+
+#include<stdio.h>
+int main()
+{
+ int circle_radius;
+
+ float PI_VALUE = 3.1416, circle_area, circle_circumference;
+ //ask for the radius
+ printf("\nInput the radius of the circle:");
+ //store the input
+ scanf_s("%d", &circle_radius);
+
+
+ //calculate circumference
+ circle_circumference = 2 * PI_VALUE * circle_radius;
+
+
+ //display the circumference
+ printf("\nCircumference is equal to: %f", circle_circumference);
+
+ return (0);
+
+}
+
+
+
+2c)
+
+#include<stdio.h>
+int main()
+{
+ int circle_radius;
+
+ float PI_VALUE = 3.1416, circle_area, circle_circumference;
+ //ask for the radius
+ printf("\nInput the radius of the circle:");
+ //store the input
+ scanf_s("%d", &circle_radius);
+
+
+ //calculate circumference
+ circle_circumference = 2 * PI_VALUE * circle_radius;
+
+
+ //display the circumference
+ printf("\nCircumference is equal to: %f", circle_circumference);
+
+ return (0);
+
+}