diff options
author | Matthew Strapp <msattr@gmail.com> | 2019-02-13 14:42:37 -0600 |
---|---|---|
committer | Matthew Strapp <msattr@gmail.com> | 2019-02-13 14:42:37 -0600 |
commit | deb4cba62f072428955bbacaa0b433773e6d7df1 (patch) | |
tree | 84b8e1f768cea0707443ff8ae638450c8772d2a0 | |
parent | Always check your code kiddos (diff) | |
download | homework-deb4cba62f072428955bbacaa0b433773e6d7df1.tar homework-deb4cba62f072428955bbacaa0b433773e6d7df1.tar.gz homework-deb4cba62f072428955bbacaa0b433773e6d7df1.tar.bz2 homework-deb4cba62f072428955bbacaa0b433773e6d7df1.tar.lz homework-deb4cba62f072428955bbacaa0b433773e6d7df1.tar.xz homework-deb4cba62f072428955bbacaa0b433773e6d7df1.tar.zst homework-deb4cba62f072428955bbacaa0b433773e6d7df1.zip |
S P A C I N
G
Diffstat (limited to '')
-rw-r--r-- | ee1301/wk2/lab2/calc.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ee1301/wk2/lab2/calc.cpp b/ee1301/wk2/lab2/calc.cpp index fbc82dd..f2e0e87 100644 --- a/ee1301/wk2/lab2/calc.cpp +++ b/ee1301/wk2/lab2/calc.cpp @@ -7,17 +7,22 @@ int main () { cout << "Enter an equation: "; cin >> a >> op >> b; cout << a << op << b << " = "; + if (op=='+'){ cout << a + b; } + if (op=='-'){ cout << a - b; } + if (op=='*'){ cout << a * b; } + if (op=='/'){ cout << a / b; } + cout << endl; } |