aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp
diff options
context:
space:
mode:
authorprestonderek <[email protected]>2022-10-07 14:28:06 -0700
committerprestonderek <[email protected]>2022-10-07 14:28:06 -0700
commitbd3e58e20fb9364470e73bbf5787bb28c00cee0b (patch)
tree657926c9bd28cbaa76a7124b19603f8103f4fd97 /CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp
parentCommit at step 6 of debug 1 (diff)
downloadcst116-ch6-debugging-prestonderek-bd3e58e20fb9364470e73bbf5787bb28c00cee0b.tar.xz
cst116-ch6-debugging-prestonderek-bd3e58e20fb9364470e73bbf5787bb28c00cee0b.zip
Step 7 of debug 1
Diffstat (limited to 'CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp')
-rw-r--r--CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp
index c45bf74..1899f81 100644
--- a/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp
+++ b/CST116-Ch6-Debugging/CST116-Ch6-Debugging.cpp
@@ -36,6 +36,7 @@
********************************************************************/
//Commit at step 6. Output was -32 which isn't right!
+//After adding () around fahrenheit - 32 I got the answer as 0C in output.
#include <iostream>
#include <iomanip>
@@ -53,7 +54,7 @@ int main()
// Breakpoint 1
// Put a breakpoint on the following line
- celcius = 5 / 9 * fahrenheit - 32;
+ celcius = 5 / 9 * (fahrenheit - 32);
cout << fahrenheit << " degrees F = "
<< celcius << " degrees C" << endl;