diff options
author | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
---|---|---|
committer | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
commit | 9d53d8857eaa1c9405894a88ca75bc4657e42f35 (patch) | |
tree | eb1efc1d028b949dd83bb710c68be8eff58f26e7 /C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp | |
download | school-code-master.tar.gz school-code-master.tar.bz2 school-code-master.zip |
Diffstat (limited to 'C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp')
-rw-r--r-- | C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp b/C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp new file mode 100644 index 0000000..bc95a35 --- /dev/null +++ b/C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp @@ -0,0 +1,19 @@ +// Given length in inches, this program outputs the equivalent +// length in feet and remaining inch(es). +#include <iostream> +using namespace std; +int main() { +int inches; //variable to store total inches + +cout << "Enter inches and press Enter: "; +cin >> inches; +cout << endl; + +cout << inches << " inch(es) = "; //output the value of +//inches and the equal sign +cout << inches / 12 << " feet (foot) and "; //output maximum +//number of feet (foot) +cout << inches % 12 << " inch(es)" << endl; //output +//remaining inches +return 0; +} |