Skip to content

Instantly share code, notes, and snippets.

@samrocketman
Last active August 29, 2015 14:07
Show Gist options
  • Save samrocketman/d071d38f85de1fb68f04 to your computer and use it in GitHub Desktop.
Save samrocketman/d071d38f85de1fb68f04 to your computer and use it in GitHub Desktop.
Inches to feet play
/*
* Sam Gleske
* Inches to feet
*/
#include <iostream>
using namespace std;
//global constants
float const INCHES_IN_FOOT = 12;
//function definitions
float calculateInchesToFeet(int inches);
int main(void)
{
cout << calculateInchesToFeet(78) << endl;
return 0;
}
float calculateInchesToFeet(int inches)
{
float feet;
feet = (float)inches / INCHES_IN_FOOT;
return feet;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment