Write a program that declares a variable named inches, which holds a length in inches, and assign a value. Display the value in feet and inches; for example: 86 inches is 7 feet and 2 inches. Be sure to use a named constant where appropriate.
When submitting the program for testing/grading, assign the value 86 to inches.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int inches=86;
int feet=inches/12;
int inch=inches-(feet*12);
cout<<inches<<" inches\n";
cout<<feet<<" feet "<<inch<<"
inches";
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.