aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk2/hw2_directory/strap012_2A.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ee1301/wk2/hw2_directory/strap012_2A.cpp')
-rw-r--r--ee1301/wk2/hw2_directory/strap012_2A.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/ee1301/wk2/hw2_directory/strap012_2A.cpp b/ee1301/wk2/hw2_directory/strap012_2A.cpp
index 9b9171f..35e9fed 100644
--- a/ee1301/wk2/hw2_directory/strap012_2A.cpp
+++ b/ee1301/wk2/hw2_directory/strap012_2A.cpp
@@ -14,10 +14,12 @@ int main () {
int countOG=0, i=0, j=0;
do {
+
do {
- cout << "Enter an integer from -50 to 50: ";
- cin >> countOG;
+ cout << "Enter an integer from -50 to 50: ";
+ cin >> countOG;
} while (countOG > 50 || countOG < -50);
+
int count=countOG; //Store original integer for comparison to break loop
if (countOG < 0){
@@ -41,6 +43,7 @@ do {
cout << endl;
}
}
+
} while (countOG != 0);
cout << "Goodbye." << endl;
return 0;