From 10f30af4a84cd3c0ede041bd42754d6e59bfa227 Mon Sep 17 00:00:00 2001 From: prestonderek Date: Wed, 12 Oct 2022 20:39:03 -0700 Subject: improved the cout statement in the while loop. --- CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp') diff --git a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp index bc59f1d..e716833 100644 --- a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp +++ b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp @@ -55,6 +55,7 @@ //Debug 2 ran to breakpoint and the while loop did not execute the cout statement. //Changed while loop to be i<10. //Ran the program at start of Exersize 3 and it's infinite 0's!!! +//added a ++ to i in the cout statement after closing the infinite program. #include using std::cout; @@ -68,7 +69,7 @@ int main() // Breakpoint 1 // Put a breakpoint on the following line while (i < 10) - cout << i << endl; + cout << i++ << endl; // Breakpoint 2 // Put a breakpoint on the following line -- cgit v1.2.3