diff options
Diffstat (limited to 'hw2/calcSigmoid.cpp')
-rw-r--r-- | hw2/calcSigmoid.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hw2/calcSigmoid.cpp b/hw2/calcSigmoid.cpp new file mode 100644 index 0000000..723ec66 --- /dev/null +++ b/hw2/calcSigmoid.cpp @@ -0,0 +1,19 @@ +// CSCI 1300 Fall 2022
+// Author: Navan Chauhan
+// Recitation: 307 – TA name
+// Homework 2 - Problem 6
+
+#include<iostream>
+#include<cmath>
+
+using namespace std;
+
+int main() {
+ double x = 0;
+ double sigmoid = 0;
+ cout << "Enter a value for x:\n";
+ cin >> x;
+ sigmoid = 1/(1+(exp(-x)));
+ cout << "The sigmoid for x=" << x << " is " << sigmoid;
+ return 0;
+}
\ No newline at end of file |