From 9d53d8857eaa1c9405894a88ca75bc4657e42f35 Mon Sep 17 00:00:00 2001 From: msglm Date: Sat, 14 Jan 2023 05:31:48 -0600 Subject: Inital Commit --- .../LengthInFeetPlusInchesRemainder.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp (limited to 'C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp') 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 +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; +} -- cgit v1.2.3