Skip to content

Instantly share code, notes, and snippets.

@mahata
Created September 11, 2011 16:52
Show Gist options
  • Save mahata/1209812 to your computer and use it in GitHub Desktop.
Save mahata/1209812 to your computer and use it in GitHub Desktop.
C++ Primer 3.1
#include <iostream>
const int inchInFeet = 12;
int main()
{
using namespace std;
cout.setf(ios_base::fixed, ios_base::floatfield);
int inch;
cout << "Please input your hight in inches: ";
cin >> inch;
cout << "Your height is: " << int(inch / inchInFeet) << " feet and " << int(inch % inchInFeet) << " inch." << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment