aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ee1301/wk2/coolHipExample.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/ee1301/wk2/coolHipExample.cpp b/ee1301/wk2/coolHipExample.cpp
new file mode 100644
index 0000000..e86f1b7
--- /dev/null
+++ b/ee1301/wk2/coolHipExample.cpp
@@ -0,0 +1,14 @@
+#include <iostream>
+#include <iomanip>
+#include <cmath>
+using namespace std;
+
+int main () {
+ int x=2,n=0;
+ int og=x;
+ for (int i=n; i>1; i--){
+ x*=og;
+ }
+
+ cout << og << "^" << n << "=" << x << endl;
+} \ No newline at end of file