Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Programming introduction / Solutions Sem. 03 / 06. Polynomial_Solutions.cpp
diff options
context:
space:
mode:
1 files changed, 18 insertions, 0 deletions
-rw-r--r--Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp18
diff --git a/Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp b/Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp
new file mode 100644
index 0000000..ba34792
--- /dev/null
+++ b/Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp
@@ -0,0 +1,18 @@
+#include <iostream>
+
+using namespace std;
+
+int main()
+{
+ int a, b, c, d, e;
+ cin >> a >> b >> c >> d >> e;
+
+ double fx;
+ for (int x = -100; x <= 100; x++)
+ {
+ fx = a * x*x*x*x + b * x*x*x + c * x*x + d * x + e;
+ if (fx >= 0)
+ cout << x << " ";
+ }
+ cout << endl;
+}