summaryrefslogtreecommitdiff
path: root/BrokenCode/BrokenCode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BrokenCode/BrokenCode.cpp')
-rw-r--r--BrokenCode/BrokenCode.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/BrokenCode/BrokenCode.cpp b/BrokenCode/BrokenCode.cpp
new file mode 100644
index 0000000..73e5c44
--- /dev/null
+++ b/BrokenCode/BrokenCode.cpp
@@ -0,0 +1,20 @@
+// BrokenCode.cpp : This file contains the 'main' function. Program execution begins and ends there.
+//This file has one logic and one syntax error
+
+#include <iostream>
+using namespace std;
+
+int main()
+{
+ const double PI = 3.142;
+ double radius, height, volume;
+
+ cout << "Input the cylinder's radius: ";
+ cin >> radius;
+ cout << "Input the cylinder's height: ";
+ cin >> height;
+
+ volume = radius * radius * radius * PI * height;
+ cout.precision(3);
+ cout << fixed << "The volume of a cyliner with radius: " << radius + ", and height: " << height << ", is " << volume;
+}