From 358161a319cc7e3d278bd425a3a0f6094e578bc7 Mon Sep 17 00:00:00 2001 From: austinsworld15 <91639488+austinsworld15@users.noreply.github.com> Date: Wed, 13 Oct 2021 14:33:42 -0700 Subject: Lab 1 --- Lab 1 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Lab 1 (limited to 'Lab 1') 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 + +//run the equation to find the circumference = <2 * 3.1416 * circle_radius> + +//print the circumference that was equated, that is the answer + + + +2b) + +#include +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 +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); + +} -- cgit v1.2.3