From 132e6e85eaecd4ac54b64cfdaa1256ca295b464a Mon Sep 17 00:00:00 2001 From: Jose Marquez <31855410+Jose-Marquez@users.noreply.github.com> Date: Thu, 12 Oct 2017 10:03:41 -0500 Subject: [PATCH] Assignment 4 Increased readability and added loop to enter a number 30 times --- Program Problem 3/Program Problem 3/Source.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Program Problem 3/Program Problem 3/Source.cpp b/Program Problem 3/Program Problem 3/Source.cpp index 4d6bfdb..8dc7b33 100644 --- a/Program Problem 3/Program Problem 3/Source.cpp +++ b/Program Problem 3/Program Problem 3/Source.cpp @@ -20,23 +20,23 @@ void pause() { void main() { - int three_digit_number; - + int three_digit_number; //assigned variables +for (int i = 0; i < 30; i++) { cout << "Enter a three digit number, "; Sleep(2000); cout << "please. : "; - cin >> three_digit_number; + cin >> three_digit_number; int x = three_digit_number; int A = x / 100; int B = (x / 10) % 10; int C = x % 10; - +//three digits are seperated using integer division if (A < B && B < C) { - cout << "Ascending..." << endl; + cout < B && B > C) { @@ -47,6 +47,8 @@ void main() { cout << "Neither..." << endl; Sleep(2000); } - +} + +//outputs if the number is ascending, descending, or neither pause(); -} \ No newline at end of file +}