aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
+
+}