summaryrefslogtreecommitdiffstats
path: root/C++/LengthInFeetPlusInchesRemainder/LengthInFeetPlusInchesRemainder.cpp
blob: bc95a35805b19ff1cd4b8243f63ead649a0df55e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
}